tests/Datory.Tests/Utils/StringUtils.cs
(开头部分) 21KB这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Text.RegularExpressions;
using System.Web;
namespace Datory.Tests.Utils
{
public static class StringUtils
{
public static string GetCacheKey(string nameofClass, params string[] values)
{
var key = $"SS.Caching.{nameofClass}";
if (values == null || values.Length <= 0) return key;
return values.Aggregate(key, (current, t) => current + ("." + t));
}
public static string GetContentTableName(int siteId)
{
return $"siteserver_Content_{siteId}";
}
public static bool Equals(string s1, string s2)
{
return s1 == s2 || string.IsNullOrEmpty(s1) && string.IsNullOrEmpty(s2);
}
public static bool EqualsIgnoreCase(string s1, string s2)
{
if (string.IsNullOrEmpty(s1) && string.IsNullOrEmpty(s2))
return true;
if (string.IsNullOrEmpty(s1) || string.IsNullOrEmpty(s2) || s2.Length != s1.Length)
return false;
return string.Compare(s1, 0, s2, 0, s2.Length, StringComparison.OrdinalIgnoreCase) == 0;
}
public static bool EndsWith(string s, char c)
{
int length = s.Length;
if (length != 0)
return (int)s[length - 1] == (int)c;
return false;
}
public static bool EndsWithIgnoreCase(string s1, string s2)
{
int indexA = s1.Length - s2.Length;
if (indexA < 0)
return false;
return string.Compare(s1, indexA, s2, 0, s2.Length, StringComparison.OrdinalIgnoreCase) == 0;
}
public static bool StartsWith(string s, char c)
{
if (s.Length != 0)
return (int)s[0] == (int)c;
return false;
}
后面还有 572 行代码,解锁后查看完整代码
24 小时内免费解锁 3 个项目,之后 1 积分/个。 规则说明
AI 解读
登录后可用,每次 10 积分,解读结果公开显示在下面。
还没有人解读过这个文件。
