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

Commit bd0c529

Browse files
committed
Save an allocation with LeftPart
1 parent c2f3313 commit bd0c529

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/ServiceStack.Text/StringExtensions.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -325,7 +325,7 @@ public static byte[] ToUtf8Bytes(this double doubleVal)
325325
public static string ToBase64UrlSafe(this byte[] input)
326326
{
327327
var output = Convert.ToBase64String(input);
328-
output = output.Split('=')[0]; // Remove any trailing '='s
328+
output = output.LeftPart('='); // Remove any trailing '='s
329329
output = output.Replace('+', '-'); // 62nd char of encoding
330330
output = output.Replace('/', '_'); // 63rd char of encoding
331331
return output;

0 commit comments

Comments
 (0)