Search
 
SCRIPT & CODE EXAMPLE
 

CSHARP

c# check if string contains character multiple times

string s = "tytyt";

var firstIndex = s.IndexOf("tyt");

var result = firstIndex != s.LastIndexOf("tyt") && firstIndex != -1;
Comment

PREVIOUS NEXT
Code Example
Csharp :: add header in action asp.net mvc 
Csharp :: select many vs select 
Csharp :: tachyons 
Csharp :: c# get all occurrences of a string 
Csharp :: dctionary literal c# 
Csharp :: how to compare time strings in c# 
Csharp :: c# slice array 
Csharp :: c# move directory 
Csharp :: How to set default page asp.net MVC 
Csharp :: Generic Stack 
Csharp :: count number of specific characters in string c# 
Csharp :: c# datediff 
Csharp :: C# Console font 
Csharp :: dotnet create web api 
Csharp :: c# how to check the minimum and maximum of numbers 
Csharp :: reference to gameobject in different scene unity 
Csharp :: *ngif vs ngif 
Csharp :: create a file in the directory of the exe and write to it c# 
Csharp :: add to ienumerable 
Csharp :: wpf app transparent background with blurred image affect 
Csharp :: c# int to short 
Csharp :: how to make a C# game launcher 
Csharp :: discord bot c# how to refresh message 
Csharp :: how to make font factory text to bold in c# 
Csharp :: dsharp emoji from string 
Csharp :: sdl quit event not working multiple windows 
Csharp :: c# check value at design time 
Csharp :: how to change font text mesh pro 
Csharp :: != in f# 
Csharp :: [1], [2], [3] 
ADD CONTENT
Topic
Content
Source link
Name
3+4 =