src/EastAsianWidthDotNet/EastAsianWidth.cs
/// <summary>
/// Get the EastAsianWidthKind of the character.
/// </summary>
/// <param name="value"></param>
/// <param name="start"></param>
/// <param name="end"></param>
/// <returns></returns>
Get the EastAsianWidthKind of the character.
Get the EastAsianWidthKind of the character .
private EastAsianWidthKind GetKind(int value, int start, int end)
        {
            int currentStart = start;
            int currentEnd = end;
            while (true)
            {
                var centerIndex = currentStart + (currentEnd - currentStart) / 2;
                var current = _ranges[centerIndex];
                if (value < current.Start)
                {
                    currentEnd = centerIndex - 1;
                    continue;
                }
                if (current.End < value)
                {
                    currentStart = centerIndex + 1;
                    continue;
                }
                return current.Kind;
            }
        }
private EastAsianWidthKind GetKind ( int value , int start , int end ) { int currentStart = start ; int currentEnd = end ; while ( true ) { var centerIndex = currentStart + ( currentEnd - currentStart ) / 2 ; var current = _ranges [ centerIndex ] ; if ( value < current . Start ) { currentEnd = centerIndex - 1 ; continue ; } if ( current . End < value ) { currentStart = centerIndex + 1 ; continue ; } return current . Kind ; } }
Get the EastAsianWidthKind of the character.
Get the EastAsianWidthKind of the character .
None
value
int
None
start
int
None
end
int
None