TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Glenn Patton
NA
308
82.8k
Search a for values in a string
Jul 17 2012 8:54 AM
Hi All,
I'm looking for a good method of searching a string for a value, if the string was all numbers I would use a Convert.ToInt16() (or 32 depending on value) but this time the string in question is "2.08.08" if this is Converted with a ToInt() method it will error as the decimal is used twice.
The reason I can't use a substring() method to chop off the first is it is a version number so all the digits are important. I could use a foreach loop to remove the stops and then convert the string (2.08.08 would become 20808) and use it like that:
foreach (string subString in USB_Version.Split(Stop))
{
output += subString + ";";
count++;
if (count == 3)
{
Version_Number = subString;
break;
}
Would this be good method or is there (as usual) a method I am not aware of??
Glenn
Reply
Answers (
6
)
Image slide show
Defined Finally and Throw Statements in c#