Search
 
SCRIPT & CODE EXAMPLE
 

CSHARP

Exit string qoutes c#

//Sentence has quotes
string nameSentence = "Take my name "Wesley" out of quotes";
//Get the index before the quotes`enter code here`
int begin = nameSentence.LastIndexOf("name") + "name".Length;
//Get the index after the quotes
int end = nameSentence.LastIndexOf("out");
//Get the part of the string with its quotes
string name = nameSentence.Substring(begin, end - begin);
//Remove its quotes
string newName = name.Replace(""", "");
//Replace new name (without quotes) within original sentence
string updatedNameSentence = nameSentence.Replace(name, newName);

//Returns "Take my name Wesley out of quotes"
return updatedNameSentence;
Comment

PREVIOUS NEXT
Code Example
Csharp :: set active for a seconds 
Csharp :: unity keep rotating object 
Csharp :: unity button addlistener 
Csharp :: random character c# 
Csharp :: remove end character of string c# 
Csharp :: unity detect if version is a build or in editor 
Csharp :: wpf rounded image 
Csharp :: InvalidOperationException: Calling Scene Raisefrom assembly reloading callbacks are not supported. 
Csharp :: c# square every digit of a number 
Csharp :: validate base64 string c# 
Csharp :: unity input.getkeyup not working 
Csharp :: check if network is available c# 
Csharp :: c# filter non alphanumeric characters 
Csharp :: c# générer un nombre aléatoire 
Csharp :: textbox only numbers c# 
Csharp :: unityWebRequest get returned data 
Csharp :: convert int to string in linq query c# 
Csharp :: get all sundays between two dates c# 
Csharp :: how to check if control key is pressed c# 
Csharp :: time.timescale 
Csharp :: c# list join 
Csharp :: list of all c# keywords 
Csharp :: unity custom editor save changes 
Csharp :: querymultiple dapper c# 
Csharp :: ession in class c# 
Csharp :: model in bootsrap 4 
Csharp :: excute bash and other linux scripts from c# 
Csharp :: tooltips unity 
Csharp :: unity random 
Csharp :: c# create file if not exists 
ADD CONTENT
Topic
Content
Source link
Name
6+2 =