on 02-14-2024 6:45 AM
Hello all,
Is there any function available for performing right substring in cpi graphical mapping?
If not can anyone help me with groovy script for the performing the right substring function?
Thanks in advance
Aditya
Hello Aditya,
Could you please check the following code:
def String rightSubstring(String str, int pos) {
if (pos < 0) {
throw new StringIndexOutOfBoundsException(pos)
}
if (str) {
int length = str.length()
if (length > pos)
return str.substring(length - pos)
else
return str
} else
return str
}
BR,
Andrzej
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
75 | |
9 | |
8 | |
7 | |
7 | |
6 | |
6 | |
6 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.