Search
 
SCRIPT & CODE EXAMPLE
 

CSHARP

c# get last character of string

string str = "Hello World";
string substr = str.Substring(str.Length - 1);
Comment

c# get last two characters of string

// str = "Hello world";
var result = str.Substring(str.Length - 2);
// result = "ld"
Comment

get last 4 character c#

string mystring = "Hellopeople";
string lastFour =  mystring.Substring(mystring.Length - 4 , 4);

Console.WriteLine(lastFour);
Comment

get last character of string c#

str = str.Substring(str.Length - 1);
Comment

c# get last 3 characters of string

var result = input.Substring(input.Length - 3);
Comment

c# last char in string

string msg = "Hello";
string last_char = msg[^1..];
Console.WriteLine(last_char); // output:  o
Comment

c# get last character of string

mystring.Substring(mystring.Length - 4);
Comment

PREVIOUS NEXT
Code Example
Csharp :: unity key down 
Csharp :: why v-slot not working in vue 3 
Csharp :: c# string to b64 
Csharp :: yanderedev 
Csharp :: unity set mouse 
Csharp :: c# get array subarray 
Csharp :: gameobject in unity c# 
Csharp :: C# get md5 of file 
Csharp :: hash table in c# 
Csharp :: c# is in array 
Csharp :: capitalize first letter c# 
Csharp :: .net get system environment variable 
Csharp :: order by length descending C# 
Csharp :: unity ui get the canvas 
Csharp :: Minimize window to system tray c# 
Csharp :: c# int array length 
Csharp :: add variable to the beginning of a list c# 
Csharp :: operator -- c# 
Csharp :: how to look around with mouse in unity 
Csharp :: dotnet new api 
Csharp :: unity c# audio source 
Csharp :: how to set a transform equal to something unity 
Csharp :: byte array to base64 c# 
Csharp :: datatable linq where clause c# 
Csharp :: c# create console for winform 
Csharp :: unity cancel momentum 
Csharp :: c# webclient post file 
Csharp :: .net core partial view with model 
Csharp :: rotation unity script 2d 
Csharp :: convert decimal to 2 decimal places c# 
ADD CONTENT
Topic
Content
Source link
Name
5+6 =