6.2.4 String methodsStrings have many methods for performing simple string manipulations. Here we list their names using the foreach command, which will be introduced in the next chapter: pyxplot> foreach m in "".methods() { print m ; } Full documentation of them can be found in Section 13.15. As in Python, the strip() method removes whitespace characters from the beginning and end of strings, and the split() method splits a string up into whitespace-separated words. The splitOn(x) method splits a string on all occurrences of the sub-string x. The following examples demonstrate the use of some of them: pyxplot> x="It was the best of times, it was the worst of times" pyxplot> x=" BEAUTIFUL new railway bridge of the Silvery Tay,"
|