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

split a string at arithmetic symbols

Status
Not open for further replies.

segmentationfault

Programmer
Jun 21, 2001
160
US
What's the most stable and convenient way to split a string at arithmetic symbols? Ideally I'd like to use the split method, but once I split the string with one symbol ("+", for example) I have an array of strings which may or may not need to be split at "-", "*", or "/", which at first glance only compounds the task since I'd like to deal with only one array when I'm finished.

Is there an existing function which can be convinced to do this for me or will I have to do this myself with a bunch of comparisons and substrings? I'm perfectly able to write this, but if there's a more standardized way, I'd love to be enlightened.
 
Well, I've written a sub that will split a non-compound arithmetic string into the numeric symbols, and then computes the sum of the positive and negative terms separately, which was my overall need.

If there is a simple way to use standard VB methods to achieve this, I'd still be happy to hear about it.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top