How to find a string with double quotes in C#

2 Answers

0 votes
using System;

class Program
{
    static void Main() {
        string str = "c c++ c# \"java\" python rust";
        
        int index = str.IndexOf("c# \"java\" p");

        Console.WriteLine(index);
    }
}

 
 
 
/*
run:
 
6
 
*/

 



answered Aug 19, 2023 by avibootz
0 votes
using System;

class Program
{
    static void Main() {
        string str = @"c c++ c# ""java"" python rust";

        int index = str.IndexOf(@"c# ""java"" p");

        Console.WriteLine(index);
    }
}

 
 
 
/*
run:
 
6
 
*/

 



answered Aug 19, 2023 by avibootz

Related questions

2 answers 258 views
1 answer 85 views
1 answer 124 views
2 answers 308 views
308 views asked Oct 14, 2018 by avibootz
2 answers 200 views
1 answer 118 views
...