The Bridge supports string manipulation operations. These operations are offered by the String class:
Internally, strings are represented as UTF-8 strings.
Escaping Characters
String literals are created by putting character sequences into single ('…') or double quotes ("…"). If the string literal contains double quotes, they can be used without escaping if the literal is enclosed by single quotes and vice versa:
"myString'StringWithinQuotes'end"
or 'myString"StringWithinDoubleQuotes"end'
An alternative to have quotes within a string is escaping the quotes with a backslash (
\"
or
\'
):
"myString\"StringWithinDoubleQuotes\"end"
or 'myString\'StringWithinDoubleQuotes\'end'
Another backslash character is quoting the backslash character itself ( \\
).
The following sections explain the various String operations.
UML Examples
Example of Basic String Operations
Figure String Manipulation Operations shows several examples of string manipulations with the Bridge.
Figure: String Manipulation Operations
If you used the following input in Figure Input Values of the String Example for the example above, you would receive the output shown in Figure Response of the String Example.
Figure: Input Values of the String Example
Running a test case with these input values would result in the following output.
Figure: Response of the String Example
Type Converter Operations
The example in figure Type Converter Operations shows the use of converter operations.
Figure:Type Converter Operations