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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

split string

Status
Not open for further replies.

MdVries

Programmer
Apr 16, 2003
47
NL
My string is "MCV-OHSOFT"

i want the string split by "-"

i want the second part of the string

How can i do that
 
? ATXRIGHT("MCV-OHSOFT","-")

See  faq184-5975 for code for ATXLEFT() and ATXRIGHT() UDFs.


Generally ATXRIGHT(MyString, MySearchString) returns everything to the right of whatever MySearchString is.




mmerlinn

"Political correctness is the BADGE of a COWARD!"

 
Herein is a concrete example of the power of Visual Foxpro. There is almost ALWAYS more than way to accomplish something.

Mike Krausnick
Dublin, California
 
Mike:

Did a quick glance at your alternative way using snippets. Looks to me another excellent way of solving one of our most common problems, chopping up strings.

For me, however, I don't see off the top of my head how I can use something like that in FP26 as nothing can be CLASSed. If I have time I might tinker with the idea of using FoxPro to write some of the code from a database containing modifiable UDFs that can be customized for a particular use.

I am already using FP to write HTML and JS code some of which is stored in a database and modified to fit the web page on the fly. So, it might not be too big a leap to do something similar with snippets of FP code.

And thanks for the thumbs up on using ATXRIGHT().





mmerlinn

"Political correctness is the BADGE of a COWARD!"

 
Thanks. When I get to the point where I need to do heavy duty string manipulation, I will look into this further. At the moment, and for a few months down the road, speed will not be an issue, so I will continue to use my UDFs in those places where speed will probably never be an issue, like string manipulation during user input.


mmerlinn

"Political correctness is the BADGE of a COWARD!"

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top