fix: 长路径支持
This commit is contained in:
1 parent
1910e96567
commit
70bec4025a
5 files changed
+95
-58
No files matched your search
@@ -14,6 +14,14 @@ public static class StringExtensions {
|
||||
return value.StartsWith(prefix, ignoreCase ? StringComparison.OrdinalIgnoreCase : StringComparison.Ordinal);
|
||||
}
|
||||
/// <summary>
|
||||
/// 高速的 StartsWith。
|
||||
/// </summary>
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public static bool StartsWithF(this string? value, char prefix, bool ignoreCase = false) {
|
||||
if (value is null) return false;
|
||||
return value.StartsWith(prefix.ToString(), ignoreCase ? StringComparison.OrdinalIgnoreCase : StringComparison.Ordinal);
|
||||
}
|
||||
/// <summary>
|
||||
/// 高速的 EndsWith。
|
||||
/// </summary>
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
@@ -21,6 +29,14 @@ public static class StringExtensions {
|
||||
if (value is null) return false;
|
||||
return value.EndsWith(suffix, ignoreCase ? StringComparison.OrdinalIgnoreCase : StringComparison.Ordinal);
|
||||
}
|
||||
/// <summary>
|
||||
/// 高速的 EndsWith。
|
||||
/// </summary>
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public static bool EndsWithF(this string? value, char suffix, bool ignoreCase = false) {
|
||||
if (value is null) return false;
|
||||
return value.EndsWith(suffix.ToString(), ignoreCase ? StringComparison.OrdinalIgnoreCase : StringComparison.Ordinal);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 忽略大小写的 Contains。
|
||||
|
||||
Reference in new issue
Block a user