Dart String Manipulations: Strings startWith & endsWith

Dart String Manipulations: Strings startWith & endsWith

StartWith:

  • A startWith() is in string a start is check your sentence is your word and character is ok to use character check.

Example:

void main()
{
    String str = "Hello World!";

    print(str.startsWith('H'));

}

Output:

true

EndWith:

  • your string is check to character in multiple data to verify character to use endWith() method

Example:

void main()
{
      String str = "Hello World!";

      print(str.endsWith('d')); // false
}

Output:

false