mirror of
https://github.com/BeyondDimension/SteamTools.git
synced 2026-10-22 01:16:17 +08:00
30 lines
724 B
C#
30 lines
724 B
C#
// ReSharper disable once CheckNamespace
|
|
namespace System
|
|
{
|
|
public static partial class StringExtensions
|
|
{
|
|
public static string TrimStart(this string s, string trimString)
|
|
{
|
|
if (trimString.StartsWith(trimString))
|
|
{
|
|
return s[trimString.Length..];
|
|
}
|
|
else
|
|
{
|
|
return s;
|
|
}
|
|
}
|
|
|
|
public static string TrimEnd(this string s, string trimString)
|
|
{
|
|
if (trimString.EndsWith(trimString))
|
|
{
|
|
return s.Substring(0, s.Length - trimString.Length);
|
|
}
|
|
else
|
|
{
|
|
return s;
|
|
}
|
|
}
|
|
}
|
|
} |