glenelly22
asked on
Split a string that can return to sub strings of it?
Hi
I want to take a string in as:- (8 characters long)
Orgstr.text = var
I then want to Split this string(var) in two, with each sub string containing 4 characters.
Also does anyone know how to refernce a character in ascic?
Thanks
Glenelly22
I want to take a string in as:- (8 characters long)
Orgstr.text = var
I then want to Split this string(var) in two, with each sub string containing 4 characters.
Also does anyone know how to refernce a character in ascic?
Thanks
Glenelly22
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Will it allways be exactly 8 chars long?
if you have a variable length string then try this
a = "whate"
b = Mid(a, 1, len(a)\2)
c = Mid(a, (len(a)\2)+1)
if you have a variable length string then try this
a = "whate"
b = Mid(a, 1, len(a)\2)
c = Mid(a, (len(a)\2)+1)
Note to all:
Not use Mid, left or right function with string.
Try to use Mid$,Left$,Right$
Cheers
Not use Mid, left or right function with string.
Try to use Mid$,Left$,Right$
Cheers
ASKER
Thanks Boss
Hehe...
I know but i allways forget ...;)
If you use the $ functions you gain ~30% Speed ....
I know but i allways forget ...;)
If you use the $ functions you gain ~30% Speed ....
Why a "B" grade?, didn't it solves your problem?
ASKER
Sorry. It did solve the problem. I didn't know that made a difference
Sorry Glenelly22
Sorry Glenelly22
He gets more Points for an "A" then for a "B"
Usually only give a B if there are some open issues. Give a C if its only a "very general" hint for what to use...
like :
"A": Use mid(mystring,5)
"B" : Use mid
"C" : Use string functions
Well kinda in this direction ;)
Usually only give a B if there are some open issues. Give a C if its only a "very general" hint for what to use...
like :
"A": Use mid(mystring,5)
"B" : Use mid
"C" : Use string functions
Well kinda in this direction ;)
rdrunner: excelent explanation LOL.
b = Mid(a, 1, 4)
c = Mid(a, 5, 4)
Print b, c