Search
 
SCRIPT & CODE EXAMPLE
 

CSHARP

remove all text after string c#

string input = "text?here";
int index = input.LastIndexOf("?"); // Character to remove "?"
if (index > 0)
    input = input.Substring(0, index); // This will remove all text after character ?
Comment

remove all letters from string c#

// add directive at the top 
using System.Text.RegularExpressions;

string numberOnly = Regex.Replace(s, "[^0-9.]", "")
Comment

PREVIOUS NEXT
Code Example
Csharp :: unity get selected gameobject 
Csharp :: unity set sprite transparency 
Csharp :: how to do fizzbuzz in c# 
Csharp :: how to parse a string to an integer c# 
Csharp :: c# reverse a string 
Csharp :: wpf yes no message box exit 
Csharp :: how to split list by date c# 
Csharp :: unity object to mouse 
Csharp :: convert dto to dictionary c# 
Csharp :: convert string to short c# 
Csharp :: c# sql duplicate key exception 
Csharp :: unity remove parent 
Csharp :: create models from database ef core 
Csharp :: c# read from file 
Csharp :: c# repeat x times 
Csharp :: c# check if string is only letters and numbers 
Csharp :: c# delay 
Csharp :: button not working unity 
Csharp :: how to pause physics in unity c# 
Csharp :: insert new item listview c# 
Csharp :: c# remove from list in foreach 
Csharp :: unity how get random color to material 
Csharp :: c# rsa example 
Csharp :: c# timer 
Csharp :: c# datetime remove time 
Csharp :: convert generic to type c# 
Csharp :: loop through string array c# 
Csharp :: wpf richtextbox clear text 
Csharp :: how to make a custom cursor in windows forms c# 
Csharp :: get current assembly path c# 
ADD CONTENT
Topic
Content
Source link
Name
7+5 =