RosettaCodeData/Task/Substring-Top-and-tail/Lasso/substring-top-and-tail-3.lasso
2023-07-01 13:44:08 -04:00

13 lines
615 B
Text

local(str = 'The quick grey rhino jumped over the lazy green fox.')
// String with first character removed
string_remove(#str,-startposition=1,-endposition=1)
// > he quick grey rhino jumped over the lazy green fox.
// String with last character removed
string_remove(#str,-startposition=#str->size,-endposition=#str->size)
// > The quick grey rhino jumped over the lazy green fox
// String with both the first and last characters removed
string_remove(string_remove(#str,-startposition=#str->size,-endposition=#str->size),-startposition=1,-endposition=1)
// > he quick grey rhino jumped over the lazy green fox