cancel
Showing results for 
Search instead for 
Did you mean: 

user defined function for getting last string in the line

former_member182412
Active Contributor
0 Kudos

Hi Experts,

I am not java expert, can anyone give me user defined function for getting last string in the line.

for example if the source field is "NEW ARBOUR SQUARE" i want to pass to target field only last string that is "SQUARE"

please help me out of this.

Kind Regards.

Praveen.

Accepted Solutions (0)

Answers (2)

Answers (2)

former_member182412
Active Contributor
0 Kudos

Thanks Ravikanth

Former Member
0 Kudos

You don't even need a UDF for this. In the graphical editor look for the standard functions and once you do a scroll over on 'text functions; you will find what you are looking for.

Just a piece of advice, try keeping UDF's to minimum unless really required or it is complicated without it.

regards

former_member181962
Active Contributor
0 Kudos

You can try this:

String lastWord = line.substring(line.lastIndexOf(' ') + 1);

Regards,

ravi