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 221 views
2 answers 323 views
1 answer 230 views
1 answer 239 views
2 answers 267 views
2 answers 369 views
...