How to get index after quotes in a string with C#

1 Answer

0 votes
using System;

class Program
{
    static void Main() {
        string str = "c c# \"java\" python c++";
        
        int index_after_quotes = str.LastIndexOf("\"") + 1;
        
        Console.WriteLine(index_after_quotes);
    }
}
 
 
 
 
 
/*
run:
 
11
 
*/

 



answered Aug 19, 2023 by avibootz

Related questions

1 answer 138 views
2 answers 217 views
1 answer 149 views
1 answer 162 views
2 answers 147 views
2 answers 272 views
...