Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to pick last word from a text

Status
Not open for further replies.

devnaren

Programmer
Aug 23, 2007
49
US
Hi All,

I want to write a formula in such a way tht it should pick last word from a text.

for eg:

"AccNo/100045/DVS/John Smith"

Now I want "John Smith" from above word.

Can anyone help me out how to get tht word from a long text.
 
Create a formula:

if instr({table.string},"/") > 0 then
split({table.string},"/")[ubound(split({table.string},"/"))] else
{table.string}

-LB
 
Not that it matters much, but I think than a simpler version should work just as well:
Code:
split({table.string},"/")[ubound(split({table.string},"/"))]
In other words, no need to test for "/".

Cheers,
- Ido



view, email, export, burst, distribute, and schedule Crystal Reports.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top