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!

Extracting Part of Name

Status
Not open for further replies.

ij76

Technical User
Mar 15, 2005
25
CA
I need to extract parts of some project names, but can't use Left(str, length) since the number of characters to extract are different. I would need it to do somehting like this:

if projectname = www
if projectname = do not include from / and on
if projectname = yyy then yyy
if projectname = yyy/zzzz, do not include from / and on

Any help would be much appreciated!
 
If you know you will have a "/" or other character you can rely on, this should formula should work.

NumberVar endStr;
if InStr ({projectname},"/") <> 0 then
endStr := InStr ({projectname},"/") - 1
else
endStr := Length ({projectname});
Left ({projectname}, endStr )
 
Wow! That's awesome, it worked.

Thank you so much!!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top