Page 1 of 1

String Manipulation Reverse / InStrRev

Posted: Thu Oct 16, 2008 1:35 am
by Nisusmage
Hello,

I have a requirement to extract a Surname from a name field. The issue is when the user has multiple second names.

How would I extract the last "field" from the string?

example:

'Joe Blogs'[' ',2,1] = 'Blogs'
'Jenny Marge Ashby'[' ',2,1] = 'Marge' *here is should be Ashby

Thanks.

Posted: Thu Oct 16, 2008 2:27 am
by DS_SUPPORT
Try

Code: Select all


Field(InputCol," ",Dcount(InputCol," "))

Change the " " (Space) to your desired delimeter.

Posted: Thu Oct 16, 2008 3:47 am
by datisaq
You can do by this way also:

Field_name[Index(Field_name," ", Count(Field_name," "))+1,len(Field_name)]

Posted: Mon Oct 20, 2008 2:56 am
by Nisusmage
Thank You Very Much.

Posted: Mon Oct 20, 2008 2:58 am
by Nisusmage
Thank You Very Much.