10-01-2018 03:29 AM - edited 03-14-2019 06:30 PM
Hi,
I have a UCCX 11.0 and in the script I have to change the called number to something else
For example I receive as called number 0XX and have to modify this to 1XX
I must use the SET step for this, but what string constructors and string methods I have to use to replace the 0 with a 1
Any help would be apreciated
Thanks
JH
10-01-2018 04:27 AM
10-01-2018 05:02 AM
Hi,
Thanks for the reply
I have found a simple way:
"1" + CalledNumber.substring(1)
This does the trick
Jan
10-01-2018 08:31 AM - edited 10-01-2018 08:32 AM
Or you can use a number of other Java String Methods under your Set step in the editor, Like .replaceFirst(string,string):
10-01-2018 08:57 AM
Also, your method is okay, so long as the Called Number is static. You will replace any occurrence of the character in the provided string ("1" in your example) no matter where it appears in the string variable... So if you are using dynamic variables, and the Called Number comes in as "3140" the method you show will convert to "3040".
....just an idea to consider.
-Sean
10-01-2018 08:58 AM
Come to think of if, so will mine... Ha ha ha... :-)
10-01-2018 09:45 AM
...this will match only the beginning part of the string with the required value, and replace it with the desired replacement string.
All string variables.
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide