substring method

String substring(
  1. int startIndex, [
  2. int? endIndex
])

trimAll: removes all spaces from a string

Implementation

String substring(int startIndex, [int? endIndex]) {
  return this?.substring(startIndex, endIndex) ?? "";
}