Answers for "remove all text after string c#"

C#
3

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 ?
Posted by: Guest on September-03-2020

Code answers related to "remove all text after string c#"

C# Answers by Framework

Browse Popular Code Answers by Language