Exit Full View

Fizzy / docs / ref / String.md

String

Creation

Use double quotes :

"Hello World"

Fields

NameTypeComments
LengthDouble

Methods

NameParametersReturn TypeComments
containsStringBoolean
endsWithStringBoolean
headDoubleStringSee note below
indexOfStringDouble-1 if not found
isBlanknoneBooleanReturns true if this string is empty or consists solely of whitespace characters.
isEmptynoneBooleanReturns true if this string contains no characters.
startsWithStringBoolean
substringstartIndex Double, endIndex DoubleStringSee note below.
tailDoubleStringSee note below

Note for tail and head :

  • If the argument > length, then the whole string is returned
  • If the argument < 0, then an empty string is returned.

Note for startWith( startIndex, endIndex ) :

  • Indices are zero based.
  • startIndex is inclusive, and endIndex is exclusive.
  • If the startIndex < 0, then it is treated as if it were 0.
  • If the endIndex > length, then it is treated as if it were length
  • If endIndex <= startIndex, then an empty string is returned.