strings
  • Overview
  • Blank
  • Empty
  • Parts
  • Safe
  • Style
  • Transform
  • Type
Powered by GitBook
On this page
  • Testing for an Empty String
  • isEmpty
  • isNotEmpty

Was this helpful?

Empty

Testing for an Empty String

An Empty String is a String that is meats at least ONE of the following criteria

  • is null

  • is zero length

isEmpty

 String isEmpty(String? string)

The isEmpty returns true if ANY ONE of the above criteria holds true

String.isEmpty(null);
-> true
String.isEmpty('');
-> true
String.isEmpty('\t\n\r ');
-> false
String.isEmpty('a');
-> false

isNotEmpty

 String isNotEmpty(String? string)

The isNotBlank returns true only if ALL of the above criteria are invalid

String.isNotEmpty(null);
-> false
String.isNotEmpty('');
-> false
String.isNotEmpty('\t\n\r ');
-> true
String.isNotEmpty('a');
-> true
PreviousBlankNextParts

Last updated 2 years ago

Was this helpful?