startsWith function

bool startsWith(
  1. String string, [
  2. dynamic target,
  3. dynamic position = 0
])

Checks if string starts with the given target string.

Implementation

bool startsWith(String string, [target, position = 0]) {
  return string.substring(position, position + target.length) == target;
}