Skip to content
This repository was archived by the owner on Dec 24, 2022. It is now read-only.

Commit b8f7e29

Browse files
committed
Add ToLowerSafe() ext methods
1 parent 347f7fd commit b8f7e29

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

src/ServiceStack.Text/StringExtensions.cs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -619,6 +619,16 @@ public static string ToLowercaseUnderscore(this string value)
619619
return sb.ToString();
620620
}
621621

622+
public static string ToLowerSafe(this string value)
623+
{
624+
return value != null ? value.ToLower() : null;
625+
}
626+
627+
public static string ToUpperSafe(this string value)
628+
{
629+
return value != null ? value.ToUpper() : null;
630+
}
631+
622632
public static string SafeSubstring(this string value, int startIndex)
623633
{
624634
return SafeSubstring(value, startIndex, value.Length);

0 commit comments

Comments
 (0)