Chop extension
Extension bundling all functions related to destructive string manipulation
- on
Methods
-
charAt(
int index) → String - Get a character from a specific index
-
codePointAt(
int index) → int - Get the unicode point value from a specific index
-
first(
int length) → String -
Extracts the first
length
characters from a string -
graphemeAt(
int index) → String -
Get a grapheme from a string specified at an
index
-
last(
int length) → String -
Extracts the last
length
characters from a string -
prune(
int pruneLength) → String -
Returns a string of reduced size. Length of returned string is
<=
pruneLength
-
slice(
int start, [int? end]) → String -
Slice from a string a partial string from
start
index toend
index. -
truncate(
int truncateLength, {String endString = "..."}) → String -
Truncates a string to the provided
truncateLength