Merge branch temp8 into temp8-U4-11227
This commit is contained in:
@@ -1069,7 +1069,7 @@ namespace Umbraco.Core
|
||||
/// <param name="replacement">The replacement character.</param>
|
||||
/// <returns>The filtered string.</returns>
|
||||
public static string ReplaceMany(this string text, char[] chars, char replacement)
|
||||
{
|
||||
{
|
||||
if (text == null) throw new ArgumentNullException(nameof(text));
|
||||
if (chars == null) throw new ArgumentNullException(nameof(chars));
|
||||
|
||||
@@ -1078,7 +1078,7 @@ namespace Umbraco.Core
|
||||
text = text.Replace(chars[i], replacement);
|
||||
|
||||
return text;
|
||||
}
|
||||
}
|
||||
|
||||
// FORMAT STRINGS
|
||||
|
||||
@@ -1148,6 +1148,8 @@ namespace Umbraco.Core
|
||||
/// <returns>The safe url segment.</returns>
|
||||
public static string ToUrlSegment(this string text)
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(text)) throw new ArgumentNullOrEmptyException(nameof(text));
|
||||
|
||||
return Current.ShortStringHelper.CleanStringForUrlSegment(text);
|
||||
}
|
||||
|
||||
@@ -1158,8 +1160,13 @@ namespace Umbraco.Core
|
||||
/// <param name="culture">The culture.</param>
|
||||
/// <returns>The safe url segment.</returns>
|
||||
public static string ToUrlSegment(this string text, string culture)
|
||||
=> Current.ShortStringHelper.CleanStringForUrlSegment(text, culture);
|
||||
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(text)) throw new ArgumentNullOrEmptyException(nameof(text));
|
||||
if (culture == null) throw new ArgumentNullException(nameof(culture));
|
||||
|
||||
return Current.ShortStringHelper.CleanStringForUrlSegment(text, culture);
|
||||
}
|
||||
|
||||
// the new methods to clean a string (to alias, url segment...)
|
||||
|
||||
/// <summary>
|
||||
|
||||
Reference in New Issue
Block a user