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 :: c# create list with range 
Csharp :: unity rotate direction by angle 
Csharp :: get folder path winforms 
Csharp :: convert list to ienumerable 
Csharp :: capitalize first letter c# 
Csharp :: list index out of range c# 
Csharp :: assign color to value in c# 
Csharp :: add text to combobox c# 
Csharp :: how add text to element in javascript 
Csharp :: unity change cursor texture 
Csharp :: linq where 
Csharp :: unity joystick movement 
Csharp :: c# list length 
Csharp :: how to create a random vector2 in unity 
Csharp :: unity string lowercase 
Csharp :: debug.log 
Csharp :: how to stop animation unity 
Csharp :: how to run async void function c# 
Csharp :: variable gameobject unity 
Csharp :: recursive reverse linked list 
Csharp :: c# generate unique key 
Csharp :: c# remove rows from datatable 
Csharp :: unity get default font 
Csharp :: website link c# 
Csharp :: c# webclient post file 
Csharp :: update listbox using class c# 
Csharp :: asp.net 5 iis HTTP Error 500.19 - Internal Server Error 
Csharp :: array object to datatable c# 
Csharp :: join array in c# 
Csharp :: how to close a form c# 
ADD CONTENT
Topic
Content
Source link
Name
9+6 =