This language bar is your friend. Select your favorite languages!

Idiom #214 Pad string on the right

Append extra character c at the end of string s to make sure its length is at least m.
The length is the number of characters, not the number of bytes.

import "strings"
import "utf8"
if n := utf8.RuneCountInString(s); n < m {
	s += strings.Repeat(c, m-n)
That's automatically the way strings are handled, as specified by the Fortran language standard.
s := UTF8PadRight(s,m,c);
s = s.ljust(m, c)
s = s.ljust(m, c)
s = s.ljust(m, c)

Do you know the best way to do this in your language ?
New implementation...