Check out example codes for "remove all text after string c#". It will help you in understanding the concepts better.

Code Example 1

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 ?

Learn ReactJs, React Native from akashmittal.com