What is the PHP strrpos() equivalent in C#

1 Answer

0 votes
using System;

public class Program
{
	public static void Main(string[] args)
	{
		string str = "c# c java c++ python go";

        int pos = str.LastIndexOf(' '); // strrpos()

		Console.WriteLine(pos);
	}
}





/*
run: 
     
20
     
*/

 



answered Aug 9, 2023 by avibootz

Related questions

1 answer 180 views
1 answer 98 views
1 answer 161 views
1 answer 170 views
1 answer 328 views
328 views asked Feb 9, 2019 by avibootz
1 answer 238 views
1 answer 155 views
...