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 132 views
2 answers 215 views
1 answer 144 views
1 answer 156 views
2 answers 146 views
2 answers 268 views
...