Search
 
SCRIPT & CODE EXAMPLE
 

CSHARP

c# get first 5 characters of string

string result = str.Substring(0,5);
Comment

c# get the first 4 characters in the list

            //get the 4 characters from the List of string
           // first convert the list into a string
            string result = string.Join("", lstData.ToArray());
          // now you can use the substring function
            var finalResult = result.Substring(0, 4);
Comment

PREVIOUS NEXT
Code Example
Csharp :: datetime month name 
Csharp :: how to append something to a string in c# 
Csharp :: linq sum 
Csharp :: how to change dictionary value in c# 
Csharp :: check if an object is active unity 
Csharp :: c# template 
Csharp :: null check syntax c# 
Csharp :: c# binary search 
Csharp :: how to read a text file C# 
Csharp :: access object property C# 
Csharp :: C# new form 
Csharp :: how to get a length of a string in c# 
Csharp :: c# how to crete array 
Csharp :: remove force unity 
Csharp :: replace first occurrence of character in string c# 
Csharp :: decrease image size C# 
Csharp :: how to turn a string in a char list c# 
Csharp :: how to store some variables on the device in unity 
Csharp :: asp.net core 6 autofac 
Csharp :: c# timer 30 seconds 
Csharp :: c# convert datetime to year & month 
Csharp :: linq find object from id 
Csharp :: why is called c# 
Csharp :: new datetime c# 
Csharp :: c# goto statement 
Csharp :: sieve of eratosthenes 
Csharp :: searching for keys in the registry 
Csharp :: dxf read c# 
Csharp :: c# mvc get current directory 
Csharp :: how to cut a string in c# 
ADD CONTENT
Topic
Content
Source link
Name
4+6 =