cancel
Showing results forย 
Search instead forย 
Did you mean:ย 

Change string based on input string

amit_saroha
New Contributor III

Hi,
I have requirement to change the value of a string in mapper based on the input string e.g.

Input value - Salary, must be replaced with IT_DEPT_COST when mapping to a variable
Input value - Phone, must be replaced with ALL_DEPT_PHONE when mapping to variable

Can you please suggest how to do it?

1 REPLY 1

bojanvelevski
Valued Contributor

.replaceAll() is the method you need. If these 2 values are the only ones you need to replace than you can apply the above method with hardcoded values. Example :

.replaceAll('Phone','ALL_DEPT_PHONE')

If you have more values to replace than I suggest you to setup a config file.

Regards