mirror of https://github.com/ogoun/Zero.git
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
26 lines
748 B
26 lines
748 B
using System;
|
|
using System.Text;
|
|
|
|
namespace ZeroLevel
|
|
{
|
|
public static class StringExtensions
|
|
{
|
|
public static bool EndsWith(this StringBuilder sb, string test)
|
|
{
|
|
if (sb == null || sb.Length < test.Length)
|
|
return false;
|
|
|
|
string end = sb.ToString(sb.Length - test.Length, test.Length);
|
|
return end.Equals(test);
|
|
}
|
|
|
|
public static bool EndsWith(this StringBuilder sb, string test,
|
|
StringComparison comparison)
|
|
{
|
|
if (sb == null || sb.Length < test.Length)
|
|
return false;
|
|
string end = sb.ToString(sb.Length - test.Length, test.Length);
|
|
return end.Equals(test, comparison);
|
|
}
|
|
}
|
|
} |