MAINSAIL Language Manual, Section 46.18

previous   next   top   contents   index   framed top   this page unframed


46.18. $removeLastWord

Figure 46–22. $removeLastWord
STRING
PROCEDURE   $removeLastWord
                        (
MODIFIES STRING s);

$removeLastWord first removes trailing whitespace characters from s, where whitespace characters are blank, tab, end-of-page, carriage return, and linefeed. It then removes all characters from the end of the STRING back to the previous whitespace character (or beginning of STRING); these characters constitute the “word”. It then removes any additional trailing whitespace characters from s, and returns the word.

Example 46–23. Use of $removeLastWord
STRING s,ss;
s := "Hellothere!";
ss := $removeLastWord(s);
Now ss = "there!" and s = "Hello,".


previous   next   top   contents   index   framed top   this page unframed

MAINSAIL Language Manual, Section 46.18