You can use any Java string method to extract characters or manipulate strings with expressions.
Example: Use the charAt() method
For example, you can return the character at a specified index in a Harness variable expression string.
This can be helpful with built-in variable expressions such as
<+artifact.image>, or variables that contain version numbers or other important strings.
To return characters, you can use the
charAt() method with your variable expression.
Let's look at an example where you have a variable named
<+version>. that evaluates to
To get the first character of the string, you would use
<+<+version>.charAt(0)>. This would return
<+version> references the variable, and the rest of the expression evaluates the string using the