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

String Manipulation

Status
Not open for further replies.

arbeeone

Technical User
Jul 17, 2005
11
AU
Hi,
I'm trying to manipulate a string of up to 40 characters in length which is basically a free-form entry although there are some basic 'standards' for data entry.
I have the feeling I'm missing something very simple, but I want to be able to identify the first alpha character (i.e. A-Z only) in the string after a specific sequence of characters - which may or may not be there.
I can use a combination of IF, SEARCH, MID and REPLACE to get to approximately where the first character should be, but there is an added complication that it might be a hyphen, with or without a space before and after it. I can use additional logic to search for and omit the hyphen and spaces, but it's getting very complicated!
So, is there a simple means of merely testing for the first alpha character from a known point in a string?

Many thanks.

rb
 
test the ASC() value of each character

eg

for i = 1 to len(theString)
theVal = Asc(mid(theString,i,1))
next i

Capital letters are in the range 65-90 (inc)
lowercase letters are in the range 97-122 (inc)

Rgds, Geoff

We could learn a lot from crayons. Some are sharp, some are pretty and some are dull. Some have weird names and all are different colours but they all live in the same box.

Please read FAQ222-2244 before you ask a question
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top