string manipulation (from earlier post)

  • Thread starter Thread starter Craig
  • Start date Start date
C

Craig

to the person who answered my last post, thank you. the
isnumeric() is what I was looking for. but instr() is not
what i'm talking about. i heard that for what i want to
do, i either want string$() or string(), but i don't know
how to use these. can anyone fill me in? and what is the
difference? i am looking for a function that takes a
number and returns the character in a string that is at
that number's position. again, if anyone can help with
this, i would appreciate it.

thank you
 
If you want the first character, use Left([MyField], 1)

If you want the last character, use Right([MyField], 1)

If you want any other position, use Mid([MyField, <insert desired number>,
1)
 
Craig said:
to the person who answered my last post, thank you. the
isnumeric() is what I was looking for. but instr() is not
what i'm talking about. i heard that for what i want to
do, i either want string$() or string(), but i don't know
how to use these. can anyone fill me in? and what is the
difference? i am looking for a function that takes a
number and returns the character in a string that is at
that number's position. again, if anyone can help with
this, i would appreciate it.


That's a bit fifferent that your other question. In this
case, you can use the Mid function:

Mid(thestring, thenumber, 1)

Be sure to check Help for the differnt function so that you
understand what they do (and don't do).

FYI, String(N, "C") will return a string of N Cs
 
Mid()

to the person who answered my last post, thank you. the
isnumeric() is what I was looking for. but instr() is not
what i'm talking about. i heard that for what i want to
do, i either want string$() or string(), but i don't know
how to use these. can anyone fill me in? and what is the
difference? i am looking for a function that takes a
number and returns the character in a string that is at
that number's position. again, if anyone can help with
this, i would appreciate it.

thank you
 
Back
Top