Fizzy / docs / ref / String.md
String
Creation
Use double quotes :
"Hello World"
Fields
Name | Type | Comments |
---|---|---|
Length | Double |
Methods
Name | Parameters | Return Type | Comments |
---|---|---|---|
contains | String | Boolean | |
endsWith | String | Boolean | |
head | Double | String | See note below |
indexOf | String | Double | -1 if not found |
isBlank | none | Boolean | Returns true if this string is empty or consists solely of whitespace characters. |
isEmpty | none | Boolean | Returns true if this string contains no characters. |
startsWith | String | Boolean | |
substring | startIndex Double, endIndex Double | String | See note below. |
tail | Double | String | See 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.