strings
-
Hi, I have a string strA = "12 MyAddress" strB = "Your Name" I want to get the first char of string and want to know weather it is integer between 1-9 or char between A-B. How can I do that.
seema
Please, please do not cross post the entire site. It's just annoying.
Christian Graus - Microsoft MVP - C++ "I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
-
Hi, I have a string strA = "12 MyAddress" strB = "Your Name" I want to get the first char of string and want to know weather it is integer between 1-9 or char between A-B. How can I do that.
seema
Because you cross-posted in three forums you are being sent to the corner with no food, caffeine or code until I am done whipping you with my TechNet magazine, or until Microsoft comes makes a bug-free operating system.
_____________________________________________ Flea Market! It's just like...it's just like...A MINI-MALL!
-
Because you cross-posted in three forums you are being sent to the corner with no food, caffeine or code until I am done whipping you with my TechNet magazine, or until Microsoft comes makes a bug-free operating system.
_____________________________________________ Flea Market! It's just like...it's just like...A MINI-MALL!
leckey wrote:
or until Microsoft comes makes a bug-free operating system
damn, for THAT long?
"Well yes, it is an Integer, but it's a metrosexual Integer. For all we know, under all that hair gel it could be a Boolean." Tom Welch
-
Hi, I have a string strA = "12 MyAddress" strB = "Your Name" I want to get the first char of string and want to know weather it is integer between 1-9 or char between A-B. How can I do that.
seema
value = "12 MyAddress" c = value.Substring(0, 1) If Char.IsDigit(c) Then Throw New Exception("its a number : " & c) End If If Char.IsLetter(c) Then Throw New Exception("its a char : " & c) End If
is it helpful for you? Basharat -
value = "12 MyAddress" c = value.Substring(0, 1) If Char.IsDigit(c) Then Throw New Exception("its a number : " & c) End If If Char.IsLetter(c) Then Throw New Exception("its a char : " & c) End If
is it helpful for you? BasharatThis does add something to the solutions alread given Specifically it adds code that doesn't perform the test he asked for, and it throws exceptions.
Christian Graus - Microsoft MVP - C++ "I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )