string str="";
int no=Convert.ToInt32(str);
priyanka_07
0
Newbie Poster
Recommended Answers
Jump to PostWhy do you want to do that? anyway you can do this
using System.Text.RegularExpressions; str=""; int no; Regex rxNums = new Regex(@"^\d+$"); // Any positive decimal if (rxNums.IsMatch(str)) { no = Convert.ToInt32(str); }
Regards.
All 3 Replies
Reply to this topic
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.