U4-2635 - Umbraco.Core.Strings string Replace(this string source, string oldString, string newString, StringComparison stringComparison) method only replaces first ocurrence of oldString

Created by Carlos Sardo 16 Aug 2013, 14:02:23 Updated by Shannon Deminick 30 Apr 2014, 01:18:56

Hi, // // Summary: // An extension method that returns a new string in which all occurrences of // a specified string in the current instance are replaced with another specified // string. StringComparison specifies the type of search to use for the specified // string. // // Parameters: // source: // Current instance of the string // // oldString: // Specified string to replace // // newString: // Specified string to inject // // stringComparison: // String Comparison object to specify search type // // Returns: // Updated string public static string Replace(this string source, string oldString, string newString, StringComparison stringComparison);

We can see that only the first occurrent of the oldString is replaced with newString.

Cheers, Carlos

Comments

John Fisher 29 Apr 2014, 13:45:46

Still present in 7.1.1. Fixed, pull request here https://github.com/umbraco/Umbraco-CMS/pull/367


Priority: Normal

Type: Bug

State: Fixed

Assignee: Shannon Deminick

Difficulty: Normal

Category:

Backwards Compatible: True

Fix Submitted: Pull request

Affected versions: 6.1.2

Due in version: 6.2.0, 7.1.2

Sprint:

Story Points:

Cycle: