Search
 
SCRIPT & CODE EXAMPLE
 

CSHARP

remove character from string C#

// our string
string myString = "test@gmail.com";

// lets remove the @ symbol
// here we replace our "@" in our string to an empty string 
string newString = myString.Replace("@", string.empty);
 
Console.Writeline(newString);
// output should look like this: testgmail.com
  
Comment

c# remove character from string at index

string s = "This is string";
s = s.Remove(2, 1);
//Output: Ths is string


string s = "This is string";
s = s.Remove(2, 2);
//Output: Th is string
Comment

c# remove char from string

// How to replace a char in string with an Empty character
string num = "1234-1234-1234-1234";
num = num.Replace("-", " ");
// result: 1234 1234 1234 1234

// How to remove a char in string
string num = "1234-1234-1234-1234";
num = num.Replace("-", string.Empty);
// result: 1234123412341234
Comment

PREVIOUS NEXT
Code Example
Csharp :: get tag unity 
Csharp :: unity text color 
Csharp :: how to get total scenes unity 
Csharp :: how to get keyboard input in unity 
Csharp :: c# empty array 
Csharp :: c# return 2 values 
Csharp :: orElseThrow 
Csharp :: disable button in android studio 
Csharp :: rotation unity script 2d 
Csharp :: C# async to sync 
Csharp :: detect collision in unity 
Csharp :: c# is odd number 
Csharp :: how to validate if date is a weekday or weekend c# 
Csharp :: verify if number c# 
Csharp :: c# binary search 
Csharp :: c# string to int 
Csharp :: check if palindrome recursion in c# 
Csharp :: pyautopgui erros 
Csharp :: remove force unity 
Csharp :: custom click event wpf button 
Csharp :: wpf stackpanel 
Csharp :: get both item and index in c# 
Csharp :: autfac .net 6 
Csharp :: unity model ripper 
Csharp :: c# make file not read only 
Csharp :: ActionExecutingContext result response return 
Csharp :: c# delete files 
Csharp :: unity master volume changer 
Csharp :: c# object is in object list 
Csharp :: How to search values in the registry 
ADD CONTENT
Topic
Content
Source link
Name
9+1 =