brgdotnet
asked on
How to check if a string value contains all of the same character ?
In VB.net, Suppose I am accepting user input as a string. I need to check for a value of Zero. However it is possible that someone could enter "000000", or "000",
Which I would consider as valid because when converted to an integer, they are equivalent. 0 = 0
Without converting this input value "000000" to an integer, what would be a good way to check if the entire string contains only the character(s) "0"
Which I would consider as valid because when converted to an integer, they are equivalent. 0 = 0
Without converting this input value "000000" to an integer, what would be a good way to check if the entire string contains only the character(s) "0"
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Welcome, glad that helped.
»bp
»bp
Are you looking at a large string (like a paragraph) or just a textbox?
ASKER