Tsallaka zuwa abun ciki
Justice Tech School

More String Methods

split, join, padLeft, startsWith, endsWith, indexOf, trim and a StringBuffer handle most text work.

Example
void main() {
  print("a,b,c".split(","));
  print(["x", "y"].join("-"));
  print("7".padLeft(3, "0"));
  print("  hi ".trim());
}

Exercise

Pad with zeros.

"7".(3, "0")

Quiz Test

Which pads on the left?

These free lessons are for learning. Join a full course for projects, mentor feedback and a verified certificate.