Search
 
SCRIPT & CODE EXAMPLE
 

CSHARP

c# IndexOf

string word = "Hello";
int where = word.IndexOf("e");
// int where returns index number where the letter "e" is located.
// --0-1-2-3-4-- < Index number
// --H-e-l-l-o-- < Word
// In this case, the letter "e" is located in the index number 1
Comment

index of c#

// index starts from zero: G-0, e-1, e-2, k-3, s-4, F-5
string str = "GeeksForGeeks";
// if character exists
str.IndexOf('F'); // result: 5 as 'F' exists at 5th index(zero-based)
// if character doesn't exist
str.IndexOf('M'): // result: -1 as 'M' doesn't exist in 'GeeksForGeeks'
Comment

indexof c#

int index = System.Array.IndexOf(array, item);
Comment

PREVIOUS NEXT
Code Example
Csharp :: unity RemoveComponent 
Csharp :: = in c# 
Csharp :: visual studio c# color dialog 
Csharp :: c# find element by condition 
Csharp :: c# itext 7 pdf add pdf 
Csharp :: how to get the hour on c# 
Csharp :: unity c# log an error or warning 
Csharp :: how to instantiate a gameobject 
Csharp :: make string uppercase c# 
Csharp :: .net c# print object 
Csharp :: c# read file from directory 
Csharp :: capitalize c# 
Csharp :: c# get array subarray 
Csharp :: total months between two dates c# 
Csharp :: c# remove items from one list that are in another 
Csharp :: read all lines from txt c# 
Csharp :: list clone - C# 
Csharp :: c# loop through list of objects 
Csharp :: c# connect tcp 
Csharp :: how return only value of array in laravel 
Csharp :: c# get last 3 characters of string 
Csharp :: c# input 
Csharp :: LINQ query to select top 5 
Csharp :: c# turn negative number into positive 
Csharp :: how to set a transform equal to something unity 
Csharp :: c# add object to array 
Csharp :: c# remove rows from datatable 
Csharp :: c# create tasks and wait all 
Csharp :: c# set cursor pos 
Csharp :: c# object list attribute to string 
ADD CONTENT
Topic
Content
Source link
Name
5+3 =