Answers for "remove first and last space from string c#"

C#
4

c# remove first 5 characters from string

str = str.Substring(n); //Where n is the number of characters you want to remove
Posted by: Guest on April-20-2020
2

remove last instance of string c#

public static string ReplaceLastOccurrence(string Source, string Find, string Replace)
{
        int place = Source.LastIndexOf(Find);

        if(place == -1)
           return Source;

        string result = Source.Remove(place, Find.Length).Insert(place, Replace);
        return result;
}
Posted by: Guest on December-14-2020

Code answers related to "remove first and last space from string c#"

C# Answers by Framework

Browse Popular Code Answers by Language