RemoveSuffix

STD.Str.RemoveSuffix( src, suffix )

STD.Uni.RemoveSuffix( src, suffix, form )

srcThe string to search.
suffix The ending string to remove.
formThe type of Unicode normalization to be employed. (NFC, NFD, NFKC, or NFKD)
Return: RemoveSuffix returns a string value.

The RemoveSuffix function returns the src string with the ending text in the suffix parameter removed. If the src string does not end with the suffix, then the src string is returned unchanged. Trailing spaces are stripped from both strings before matching.

Example:

IMPORT STD;
STD.STr.RemoveSuffix('a word away','away');   //returns 'a word'
STD.STr.RemoveSuffix('a word a way','away');  //returns 'a word a way'