c# remove spaces from string
C#
string str = "This is a test";
str = str.Replace(" ", String.Empty);
// Output: Thisisatestusing System;
using System.Text.RegularExpressions;
public class Program
{
public static void Main()
{
string yourString = "The value is: 99 086.78";
string newString = ""; // MUST set the Regex result to a variable for it to take effect
newString = Regex.Replace(yourString, @"\s+", ""); //Replaces all(+) space characters (\s) with empty("")
Console.WriteLine(newString);
// Output: Thevalueis:99086.78
}
}
Also in C#:
- Title
- c# how to have a multiline console.writeline
- Category
- C#
- Title
- unity print to console
- Category
- C#
- Title
- set label position winforms
- Category
- C#
- Title
- Celsius to Fahrenheit c#
- Category
- C#
- Title
- populate combobox from array c#
- Category
- C#
- Title
- convert array to list Unity C#
- Category
- C#
- Title
- c# stop loop
- Category
- C#
- Title
- how to trim path in C#
- Category
- C#
- Title
- c# get all class properties
- Category
- C#
- Title
- how to convert object in string JSON c#
- Category
- C#
- Title
- c# get current date
- Category
- C#
- Title
- void Update
- Category
- C#
- Title
- asp.net core redirecttoaction with parameters
- Category
- C#
- Title
- check if two timespans intersect c#
- Category
- C#
- Title
- list.addrange in c#
- Category
- C#
- Title
- c# reverse array
- Category
- C#
- Title
- c# int
- Category
- C#
- Title
- combine two arraylist c#
- Category
- C#
- Title
- how to populate listbox using list<t> c#
- Category
- C#
- Title
- unity to integer
- Category
- C#
- Title
- c# warning CS0108
- Category
- C#
- Title
- how to compare datetime in c#
- Category
- C#
- Title
- object escape player unity
- Category
- C#
- Title
- c# clone stream
- Category
- C#
- Title
- c# how to refresh your binding source
- Category
- C#
- Title
- pop up element from specific index in array
- Category
- C#
- Title
- array c#
- Category
- C#
- Title
- .net identity seed users and roles
- Category
- C#
- Title
- C# get all child classes of a class
- Category
- C#
- Title
- wpf restart application c#
- Category
- C#
- Title
- c# create new thread
- Category
- C#
- Title
- c# expandoobject indexer
- Category
- C#
- Title
- how to load the active scene unity
- Category
- C#
- Title
- c# quick "is" "as"
- Category
- C#
- Title
- linq c# or
- Category
- C#
- Title
- asp.net mvc 5 codefirst dropdown list
- Category
- C#
- Title
- convert double to currency c#
- Category
- C#
- Title
- c# main method
- Category
- C#
- Title
- c# string to character array
- Category
- C#
- Title
- string.charat c#
- Category
- C#
- Title
- Generate Genealogy view in mvc C# using Google Organizational Chart
- Category
- C#
- Title
- How to execute a script after the c# function executed
- Category
- C#
- Title
- c# how to initialize an array
- Category
- C#
- Title
- debug.log
- Category
- C#
- Title
- how to detect if a key is pressed in c#
- Category
- C#
- Title
- unity how to rotate something to point to something else
- Category
- C#
- Title
- c# mailmessage set sender name
- Category
- C#
- Title
- unity how to check object position
- Category
- C#
- Title
- chase object unity
- Category
- C#
- Title
- external font family uwp c#
- Category
- C#
- Title
- is start called after dontdestroyonload
- Category
- C#
- Title
- c# AllowSynchronousIO to true
- Category
- C#
- Title
- C# .NET Core linq Distinct
- Category
- C#
- Title
- interpolate rotation unity3d
- Category
- C#
- Title
- unity enable gameobject
- Category
- C#
- Title
- use newtonsoft json to clone object
- Category
- C#
- Title
- string to guid c#
- Category
- C#
- Title
- lat long data type c#
- Category
- C#
- Title
- using serial port in c#
- Category
- C#
- Title
- get setter c# model
- Category
- C#
- Title
- C# extend array
- Category
- C#
- Title
- singleton design pattern c# volatile
- Category
- C#
- Title
- c# empty IEnumerable
- Category
- C#
- Title
- c# changimg to one decimal place
- Category
- C#
- Title
- c# foreach namevaluecollection
- Category
- C#
- Title
- wpf textblock line break code behind
- Category
- C#
- Title
- c# string methods
- Category
- C#
- Title
- convert system.byte a string c#
- Category
- C#
- Title
- c# print expression tree
- Category
- C#
- Title
- create dropdown in datatable c# dynamically
- Category
- C#
- Title
- unity make a int arry with preset values
- Category
- C#
- Title
- unity instantiate
- Category
- C#
- Title
- fahrenheit to celsius c#
- Category
- C#
- Title
- movement script c#
- Category
- C#
- Title
- define enum c#
- Category
- C#
- Title
- Request.Form
- Category
- C#
- Title
- c# to vb.net
- Category
- C#
- Title
- get number of sundays in a month c#
- Category
- C#
- Title
- linq query select top 1 c#
- Category
- C#
- Title
- remove from list based on condition c#
- Category
- C#
- Title
- download and run exe c# 1 button
- Category
- C#
- Title
- c sharp check if key in dictionary
- Category
- C#
- Title
- C# .net core convert string to enum
- Category
- C#
- Title
- c# listview
- Category
- C#
- Title
- decimals not stored in azure tables
- Category
- C#
- Title
- How to get the world position of the edge of an object?
- Category
- C#
- Title
- unity rb.addexplosionforce 2d
- Category
- C#
- Title
- Request.ServerVariables["HTTP_X_FORWARDED_FOR"] get only one ipaddress
- Category
- C#
- Title
- landscape print gridcontrol devexpress
- Category
- C#
- Title
- delegate function c#
- Category
- C#
- Title
- c# razor add disabled to button if
- Category
- C#
- Title
- C# graph api upload file one drive
- Category
- C#
- Title
- how to flip selection in aseprite
- Category
- C#
- Title
- how to turn 3 floats into quartenion
- Category
- C#
- Title
- unity method on scene loaded
- Category
- C#
- Title
- jumping with character controller unity
- Category
- C#
- Title
- find mongodb c# with task T
- Category
- C#
- Title
- c# polymorphism
- Category
- C#
- Title
- c# return multiple value unity
- Category
- C#
- Title
- how to name GameObject in c#
- Category
- C#