|
|
От: | Kore Sar | |
| Дата: | 10.12.08 13:22 | ||
| Оценка: | |||
KS>> myStrings[i] = rnd.Next(1000000).ToString("{0:D6}"); // 6 digits
KS>> patterns[i] = rnd.Next(2) == 0 ? rnd.Next(1000).ToString() : myStrings[i].Substring(3);
KS>>KS>>U.StartWith: 00:00:00.0330000
KS>>String.StartsWith: 00:00:00.0490000
U.StartWith: 00:00:00.041
String.StartsWith: 00:00:00.052
public static class MyExtentionMethods
{
public static bool AsciiStartsWith(this string str, string pattern)
{
if (pattern.Length > number.Length) return false;
bool match = true;
for (int digitIndex = 0; digitIndex < pattern.Length && match; digitIndex++)
{
match = match && number[digitIndex].Equals(pattern[digitIndex]);
}
return match;
}
}