in Education by
I want to convert the matched expression in string or int. But in .NET Framework I do not find any method to do this. I've tried this s=+OK 58 exists; var m = Regex.Match(s, @"\+OK (?[0-9]+)"); Console.WriteLine("Total Email: " + m.Groups["totalemail"].Value); string s1= Convert.ToString(m.Groups["totalemail"].Value); Console.WriteLine(s1); This first writeline prints 58 and the second WriteLine() call prints nothing that means s1="". If I use int conversion like this int s=Convert.ToInt32(m.Groups["totalemail"].Value); then it shows error Input String is not in correct format. Is it possible to convert matched regular expression to string or int? if possible please give help. Thanks in advance. JavaScript questions and answers, JavaScript questions pdf, JavaScript question bank, JavaScript questions and answers pdf, mcq on JavaScript pdf, JavaScript questions and solutions, JavaScript mcq Test , Interview JavaScript questions, JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)

1 Answer

0 votes
by
You have a typo. This: "totalemail]" should be this: "totalemail"

Related questions

0 votes
    In C#, int and Int32 are the same thing, but I've read a number of times that int is preferred ... , JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Mar 31, 2022 in Education by JackTerrance
0 votes
    In C#, int and Int32 are the same thing, but I've read a number of times that int is preferred ... , JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Mar 29, 2022 in Education by JackTerrance
0 votes
    In C#, int and Int32 are the same thing, but I've read a number of times that int is preferred ... , JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Mar 27, 2022 in Education by JackTerrance
0 votes
    Which of the following matches end of the string using regular expression in java? (a) \z (b) \\ (c ... Regular Expressions of Java Select the correct answer from above options...
asked Feb 24, 2022 in Education by JackTerrance
0 votes
    Which of the following matches end of the string using regular expression in java? (a) \z (b) \\ ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Oct 24, 2021 in Education by JackTerrance
0 votes
    I want to convert an int to a byte[2] array using BCD. The int in question will come from ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Jun 30, 2022 in Education by JackTerrance
0 votes
    Lets say I have the option of identifying a code path to take on the basis of a string comparison ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Mar 17, 2022 in Education by JackTerrance
0 votes
    Lets say I have the option of identifying a code path to take on the basis of a string comparison ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Mar 17, 2022 in Education by JackTerrance
0 votes
    I want create expression with reflection in c#. I am target script is: using (var service = new ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Jun 14, 2022 in Education by JackTerrance
0 votes
    Please help me in understanding the following C Output: #include int main() { float x = 4.0; ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Feb 9, 2022 in Education by JackTerrance
0 votes
    Please help me in understanding the following C Output: #include int main() { float x = 4.0; ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Feb 7, 2022 in Education by JackTerrance
0 votes
    Please help me in understanding the following C Output: #include int main() { float x = 4.0; ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Feb 7, 2022 in Education by JackTerrance
0 votes
    Please help me in understanding the following C Output: #include int main() { float x = 4.0; ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Feb 7, 2022 in Education by JackTerrance
0 votes
    Please help me in understanding the following C Output: #include int main() { float x = 4.0; ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Feb 5, 2022 in Education by JackTerrance
0 votes
    Please help me in understanding the following C Output: #include int main() { float x = 4.0; ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Feb 5, 2022 in Education by JackTerrance
...