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 :: hello world c 
Csharp :: how to get the directory of the project in c# 
Csharp :: c# wait seconds 
Csharp :: smooth rotation unity 
Csharp :: read file c# 
Csharp :: how to move mouse in game c# 
Csharp :: unity reload current scene 
Csharp :: path desktop c# 
Csharp :: new Color from hex in unity 
Csharp :: setactive unity 
Csharp :: c# mysql query 
Csharp :: set text in center wpf 
Csharp :: c# absolute value 
Csharp :: email regex c# 
Csharp :: how to do cmd command c# 
Csharp :: open new window c# wpf 
Csharp :: c# get next item in list 
Csharp :: c# convert string to char array 
Csharp :: c# write to console 
Csharp :: how to set image Source in the code C# 
Csharp :: C# unity link button 
Csharp :: how to make a pause feautre in unity 
Csharp :: C# infinite clock coroutine loop 
Csharp :: how to copy a file in c# 
Csharp :: how to be like bill gates 
Csharp :: C# data table primary key from 2 columns 
Csharp :: gcd c# 
Csharp :: unity 3d sound 
Csharp :: detect keypress c# 
Csharp :: c# datetime get number of week 
ADD CONTENT
Topic
Content
Source link
Name
6+1 =