trueneutral
Programmer
I've been pulling some data from the database, and it's returning a string of 10 characters. (I can't modify the database, so I have to do this programically) If there is no value in the string, it still returns a length 10 string with 10 invisible characters (The data type from the database is Char, and I've tried changing the values to something else, it doesn't work).
I want to try to modify this string as they're coming in. If they contain no numbers, I want to trim the string down to nothing(I've tried .trim(), it doesn't work).
So far, I can't tell what is IN the string at all. It doesn't seem to think it's a Null value, white space, punctuation etc. it seems to think EVERY character is a number even when there is definately is no numbers.
I have tried this code:
code:--------------------------------------------------------------------------------
If charAr(1).IsPunctuation(charAr(0)) = True Then Response.Write("We have a Punctuation!<BR>"
If charAr(1).IsWhiteSpace(charAr(0)) = True Then Response.Write("We have a WhiteSpace!<BR>"
If charAr(1).IsSeparator(charAr(0)) = True Then Response.Write("We have a Separator!<BR>"
If charAr(1).IsSurrogate(charAr(0)) = True Then Response.Write("We have a Surrogate!<BR>"
If charAr(1).IsSymbol(charAr(0)) = True Then Response.Write("We have a Symbol!<BR>"
If charAr(1).IsNumber(charAr(0)) = True Then Response.Write("We have a Number!<BR>"
If charAr(1).IsLetter(charAr(0)) = True Then Response.Write("We have a Letter!<BR>"
--------------------------------------------------------------------------------
And it Always returns "We have a number!" no matter what the content of the string may be (including letters).
I have also tried
code:--------------------------------------------------------------------------------
If charAr(1).IsNumber(charAr(0)) = True Then
temp = charAr(1).GetNumericValue(charAr(0))
If temp >= 0 And temp <= 9 Then Response.Write("We have a Number!<BR>"
End If
--------------------------------------------------------------------------------
And it still alwaysthinks it's a number, even when there is no number in there.
is there any other way to test for what the character IS in this string? Or is there a good way to showme what's in the string so I can create an if statement to ignore those characters?
Thank you, anyone who has suggestions
I want to try to modify this string as they're coming in. If they contain no numbers, I want to trim the string down to nothing(I've tried .trim(), it doesn't work).
So far, I can't tell what is IN the string at all. It doesn't seem to think it's a Null value, white space, punctuation etc. it seems to think EVERY character is a number even when there is definately is no numbers.
I have tried this code:
code:--------------------------------------------------------------------------------
If charAr(1).IsPunctuation(charAr(0)) = True Then Response.Write("We have a Punctuation!<BR>"
If charAr(1).IsWhiteSpace(charAr(0)) = True Then Response.Write("We have a WhiteSpace!<BR>"
If charAr(1).IsSeparator(charAr(0)) = True Then Response.Write("We have a Separator!<BR>"
If charAr(1).IsSurrogate(charAr(0)) = True Then Response.Write("We have a Surrogate!<BR>"
If charAr(1).IsSymbol(charAr(0)) = True Then Response.Write("We have a Symbol!<BR>"
If charAr(1).IsNumber(charAr(0)) = True Then Response.Write("We have a Number!<BR>"
If charAr(1).IsLetter(charAr(0)) = True Then Response.Write("We have a Letter!<BR>"
--------------------------------------------------------------------------------
And it Always returns "We have a number!" no matter what the content of the string may be (including letters).
I have also tried
code:--------------------------------------------------------------------------------
If charAr(1).IsNumber(charAr(0)) = True Then
temp = charAr(1).GetNumericValue(charAr(0))
If temp >= 0 And temp <= 9 Then Response.Write("We have a Number!<BR>"
End If
--------------------------------------------------------------------------------
And it still alwaysthinks it's a number, even when there is no number in there.
is there any other way to test for what the character IS in this string? Or is there a good way to showme what's in the string so I can create an if statement to ignore those characters?
Thank you, anyone who has suggestions