ayufans
asked on
how to find the first two char of a string ?
Hi..
How do you find the first two char of a string ? for example :
the string is "Whaddaheck".
How do I get only "Wh" and "ck" in the back ? in SQL we can simply use left and right syntax, but what about in VB 6.0 ?? should it be inst, substr or something ? I'm really lost here.. I know it's possible, since I've done it once, but what is the syntax to use ??? please lemme know...
Thanks.
How do you find the first two char of a string ? for example :
the string is "Whaddaheck".
How do I get only "Wh" and "ck" in the back ? in SQL we can simply use left and right syntax, but what about in VB 6.0 ?? should it be inst, substr or something ? I'm really lost here.. I know it's possible, since I've done it once, but what is the syntax to use ??? please lemme know...
Thanks.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Just send it to a variable instead of a messagebox:
dim strLeftTwo as string
dim strRightTwo as string
strLeftTwo = Left("Whaddaheck", 2)
strRightTwo = Right("Whaddaheck", 2)
*** Please award the points to mnasman as he deserves the credit for this ***
dim strLeftTwo as string
dim strRightTwo as string
strLeftTwo = Left("Whaddaheck", 2)
strRightTwo = Right("Whaddaheck", 2)
*** Please award the points to mnasman as he deserves the credit for this ***
Also if you are dealing with a sting and you know it dont use left and right ... use left$ and right$ - they are about 25 % faster ;)
ASKER
thanks both, I'm awarding the point to mnasman according to the instruction ^_^ thanks.
ayufans, I see that you give many low grades on questions - this could cause experts to ignore your questions.
Why did you give the B? Was there a problem with the answer? Did you expect more? If not, please award Mohammed (mnasman) a grade of A.
You can do this by posting a 0-point question in the Community Support topic:
https://www.experts-exchange.com/Community_Support/
please include the URL to this question
You can get information on grading questions and other information in the help section. See this for example
https://www.experts-exchange.com/Programming/Programming_Languages/Visual_Basic/cmtyQuestAnswer.jsp#3
Why did you give the B? Was there a problem with the answer? Did you expect more? If not, please award Mohammed (mnasman) a grade of A.
You can do this by posting a 0-point question in the Community Support topic:
https://www.experts-exchange.com/Community_Support/
please include the URL to this question
You can get information on grading questions and other information in the help section. See this for example
https://www.experts-exchange.com/Programming/Programming_Languages/Visual_Basic/cmtyQuestAnswer.jsp#3
ASKER