IKVM11  11
Java SE 11 Virtual Machine for .NET
Loading...
Searching...
No Matches
ReadOnlySpanCharExtensions.cs
Go to the documentation of this file.
1using System;
2
4{
5
10 {
11
17 public static int GetHashCodeExtension(this ReadOnlySpan<char> span)
18 {
19#if NETFRAMEWORK
20 return span.ToString().GetHashCode();
21#else
22 return string.GetHashCode(span);
23#endif
24 }
25
31 public static bool OnlyNumbers(this ReadOnlySpan<char> span)
32 {
33 foreach (var c in span)
34 if (char.IsNumber(c) == false)
35 return false;
36
37 return true;
38 }
39
40 }
41
42}
Provides extension methods for working with ReadOnlySpan<Char>.
static int GetHashCodeExtension(this ReadOnlySpan< char > span)
Returns a hashcode for this string.
static bool OnlyNumbers(this ReadOnlySpan< char > span)
Returns true if every member is a number.