Quantcast
Channel: Answers for "C# Check First Letter of String"
Viewing all articles
Browse latest Browse all 11

Answer by unity_Uxrdlqpo2JUXMA

$
0
0
/// /// Replaces the first occurrence. /// /// The source. /// The find. /// The replace. /// public static string ReplaceFirstOccurrence(string Source, string Find, string Replace) { int Place = Source.IndexOf(Find); string result = Source.Remove(Place, Find.Length).Insert(Place, Replace); return result; } /// /// Replaces the last occurrence. /// /// The source. /// The find. /// The replace. /// public static string ReplaceLastOccurrence(string Source, string Find, string Replace) { int Place = Source.LastIndexOf(Find); string result = Source.Remove(Place, Find.Length).Insert(Place, Replace); return result; }

Viewing all articles
Browse latest Browse all 11

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>