SetStringMid | Change a substring |
StringMid | Retrieve a substring |
String, Atom | Convert atom to string and vice versa |
ConcatStrings | Concatenate strings |
LocalSymbols | Create unique local symbols with given prefix |
PatchString | Execute commands between <? and ?> in string |
In> SetStringMid(3,"XY","abcdef") Out> "abXYef"; |
In> StringMid(3,2,"abcdef") Out> "cd"; In> "abcdefg"[2 .. 4] Out> "bcd"; |
String is the inverse of Atom: turns atom into "atom".
In> String(a) Out> "a"; In> Atom("a") Out> a; |
In> ConcatStrings("a","b","c") Out> "abc"; |
This is useful in cases where a guaranteed free variable is needed, like in the macro-like functions (For, While, etc.).
In> LocalSymbols(a,b)a+b Out> $a6+ $b6; |
In> PatchString("Two plus three is <? Write(2+3); ?> "); Out> "Two plus three is 5 "; |