Skip to content

Instantly share code, notes, and snippets.

@Deleplace
Created March 29, 2022 20:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Deleplace/a09897029806a0151573b7f294139d4b to your computer and use it in GitHub Desktop.
Save Deleplace/a09897029806a0151573b7f294139d4b to your computer and use it in GitHub Desktop.
Pad string on the right
void main() {
var inputs = [
"",
"a",
"ab",
"abc",
"abcd",
"é",
];
var m = 3;
var c = "-";
inputs.forEach((s) {
s = s.padRight(m, c);
print(s);
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment