cancel
Showing results for 
Search instead for 
Did you mean: 

Java Simple

Former Member
0 Kudos

How do you combine methods in one UDF...

For example I want to convert a string to lower case and the replace characters...

I have done the following code:

return a.toLowerCase();

return a.replace('a', 'z');

Yet I do not get the result I want.... The string is converted to lower case but it does not replace the characters...

So please let me know how I combine methods in a UDF...

So step 1 would be toLoawerCase

step 2 would be a.replace

Accepted Solutions (1)

Accepted Solutions (1)

MichalKrawczyk
Active Contributor
0 Kudos

hi Alex,

you can only return one value

String b = a.toLowerCase();

return b.replace('a', 'z');

Regards,

michal

Answers (2)

Answers (2)

Former Member
0 Kudos

Thank you people... They both worked very successfully

Former Member
0 Kudos

hI Alex,

try this code:

return a.toLowerCase().replace('a', 'z');

Hope this help

Francesco