Compose-3000: Working with Strings in OML
- Create and assign a string.
- String concatenation.
- Replace a string.
- Split a string.
- Compare a string.
Creating and Assigning a String
Strings are any object enclosed by single quotes. For example:
'Hello World'
To assign this string to a variable we simply write:
a= 'Hello World'
Note that a double quote is not a valid string delimiter in this release of OML, and it will return an error:
Below are valid string literals:
Manipulating Strings with Concatenation
Replace a String
There are several ways to replace a substring with another: