Link to home
Start Free TrialLog in
Avatar of glenelly22
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
ASKER CERTIFIED SOLUTION
Avatar of TimCottee
TimCottee
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of rengaraaj
rengaraaj

a = "abcdefgh"
b = Mid(a, 1, 4)
c = Mid(a, 5, 4)
Print b, c
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)
Avatar of Richie_Simonetti
Note to all:
Not use Mid, left or right function with string.
Try to use Mid$,Left$,Right$
Cheers
Avatar of glenelly22

ASKER

Thanks Boss
Hehe...

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?
Sorry. It did solve the problem. I didn't know that made a difference

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  ;)

rdrunner: excelent explanation LOL.