About 46,400 results
Open links in new tab
  1. How can get a substring from a string in C#? - Stack Overflow

    Nov 9, 2021 · 25 I have a large string and it’s stored in a string variable, str. And I want to get a substring from that in C#. Suppose the string is: " Retrieves a substring from this instance. The substring starts …

  2. How to get the first n number of characters from a string?

    I have read this question to get first char of the string. Is there a way to get the first n number of characters from a string in C#?

  3. How to get the last five characters of a string using Substring() in C#?

    I can get the first three characters with the function below. However, how can I get the output of the last five characters ("Three") with the Substring() function? Or will another string function

  4. string - Substring IndexOf in c# - Stack Overflow

    Mar 4, 2016 · Substring IndexOf in c# Asked 9 years, 9 months ago Modified 4 years, 5 months ago Viewed 27k times

  5. c# - Substring a string from the end of the string - Stack Overflow

    Jun 24, 2011 · How about the String.Substring method? You can get the length using the Length property, subtract two from this, and return the substring from the beginning to 2 characters from the …

  6. Find text in string with C# - Stack Overflow

    How can I find given text within a string? After that, I'd like to create a new string between that and something else. For instance, if the string was: This is an example string and my data is he...

  7. c# - How do I extract a substring from a string until the second space ...

    Jan 11, 2015 · How do I extract a substring from a string until the second space is encountered? Asked 15 years, 8 months ago Modified 3 years, 9 months ago Viewed 173k times

  8. c# - How do I extract text that lies between parentheses (round ...

    Feb 18, 2015 · I have a string User name (sales) and I want to extract the text between the brackets, how would I do this? I suspect sub-string but I can't work out how to read until the closing bracket, …

  9. c# - Get Substring - everything before certain char - Stack Overflow

    I'm trying to figure out the best way to get everything before the - character in a string. Some example strings are below. The length of the string before - varies and can be any length 223232-...

  10. C# Get substring with specific pattern from string - Stack Overflow

    Feb 14, 2013 · C# Get substring with specific pattern from string Asked 12 years, 10 months ago Modified 12 years, 10 months ago Viewed 50k times