The following are the Text and String functions you can use in COD scripts. In most cases, the syntax can be copied/pasted directly into a file and function properly. They should be edited for your particular use. This allows you to short cut your time by not having to experiment to figure out code syntax.
| Function | Example | Return Value |
|---|---|---|
| asc | asc("A") | 65 |
| ascii | ascii(65) | "A" |
| chr | chr("Autodesk", 5) | "d" |
| getfileext | getfileext("c:\(temp)\test.txt") getfileext("c:/(temp)/test.txt") getfileext("c:/(temp)/test.txt") | ".txt" |
| getfilename | getfilename("c:\\(temp)\test.txt") getfilename("c:/(temp)/test.txt") | "test.txt" |
| getfilepath | getfilepath("c:\(temp)\test.txt") getfilepath("c:/(temp)/test.txt") | "c:/(temp)/ " |
| instr | instr(1, "Autodesk", "D”, False) instr(1, "Autodesk", "D”, True) instr(6, "Autodesk", "D”, False) | 5 0 0 |
| left | left("Autodesk", 4) | "Auto" |
| len | len("Autodesk") | 8 |
| lower | lower("Autodesk") | "autodesk" |
| ltrim | ltrim(" Autodesk ") | "autodesk " |
| mid | mid("Autodesk", 5, 2) | "de" |
| right | right("Autodesk", 4) | "desk" |
| rtrim | rtrim(" Autodesk ") | " autodesk" |
| substring | substring("Autodesk", 3, 4) substring("Autodesk", 2, 7) | "to" "utodes" |
| trim | trim(" Autodesk ") | "autodesk" |
| upper | upper("Autodesk") | "AUTODESK" |
| wildcard | wildcard("Autodesk", "*desk") wildcard("Autodesk", "*chair") wildcard("Autodesk", "?ut?d*") | 1 0 1 |