utf8.strpad

STRINGutf8.strpadSTRINGsINTEGERcountSTRINGpad

Available inall subroutines.

Like std.strpad except count gives the number of Unicode code points for the output string rather than bytes.

Errors

This function requires the input strings s and pad to be UTF-8 encoded. If they are not, fastly.error will be set to EUTF8.

Example

utf8.strpad("abc", 7, "๐ŸŒธ๐ŸŒผ"); # gives "๐ŸŒธ๐ŸŒผ๐ŸŒธ๐ŸŒผabc", seven code points total
std.strpad("abc", 7, "๐ŸŒธ๐ŸŒผ"); # gives "๐ŸŒธabc" because ๐ŸŒธ is four bytes