Checkout My New App! Twiks GPT Chat, an app which let's you to use Chat GPT API with your own API Key

Muhammed Mukhthar CM

The Dart String Trim method

Aug 21, 2021

The Dart trim() method returns the given String after removing whitespaces at the beginning and end of the String.


" SampleText".trim() // "SampleText"
"SampleText ".trim() // "SampleText"
" SampleText ".trim() // "SampleText"
"SampleText".trim() // "SampleText"

Note that, this will not remove whitespace in the middle of a sentence.

Join my email list to get the latest posts and updates.