Split string problem
-
Respected, I have a string like JC00123 and I am split this string from from 2th position but it not give proper o/p. It split like this 123 only except the zeros Please help me. Thanks
-
Respected, I have a string like JC00123 and I am split this string from from 2th position but it not give proper o/p. It split like this 123 only except the zeros Please help me. Thanks
Please post the code you have written for splitting the string.
-
Please post the code you have written for splitting the string.
The code is : grno = "JC00234" Dim splitgrno As Int32 = CType(grno.Substring(2), Int32)
-
The code is : grno = "JC00234" Dim splitgrno As Int32 = CType(grno.Substring(2), Int32)
- You're using Visual Basic. 1) You're not "splitting" the string, you're extracting part of it. 2) You're converting "000234" to an integer. The integer will be equal to 234. If you want to maintain the leading zeros, you have to leave it as (or convert it back to) a string. 3) I've noticed this leading-zeros on an integer question pop up several times this week. Will you guys please tell your instructors to give you the low-down on this particular topic BEFORE giving you your homework assignment.
.45 ACP - because shooting twice is just silly
-----
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997
-----
"The staggering layers of obscenity in your statement make it a work of art on so many levels." - J. Jystad, 2001