Hi ,
I have a requirement where I need to get the last word after space..e.g:
from ABC XYZ I should pick XYZ and from ABC XYZ ASD I should pick ASD....
Please suggest...
Regards,
how to get the last word after space
Moderators: chulett, rschirm, roy
-
- Participant
- Posts: 101
- Joined: Mon Aug 13, 2007 2:32 am
One solution: use DCount() to get the number of fields then use that count in the Field() function to get the last field:
Code: Select all
Field(YourField," ",DCount(YourField," "),1)
-craig
"You can never have too many knives" -- Logan Nine Fingers
"You can never have too many knives" -- Logan Nine Fingers
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
If DCount() is identified as invalid when you validate the expression, use Count() instead.
Code: Select all
Field(YourField," ",Count(YourField," ")+1,1)
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact: