src/EastAsianWidthDotNet/EastAsianWidth.cs
/// <summary>
/// Get the width of the string considering EastAsianWidth by specifying whether it is East Asia.
/// </summary>
/// <param name="value"></param>
/// <param name="isEastAsia"></param>
/// <returns></returns>
Get the width of the string considering EastAsianWidth by specifying whether it is East Asia.
Get the width of the string considering EastAsianWidth by specifying whether it is East Asia .
public int GetWidth(string value, bool isEastAsia)
        {
            int width = 0;
            foreach (var c in value)
            {
                width += IsFullWidth(c, isEastAsia) ? 2 : 1;
            }
            return width;
        }
public int GetWidth ( string value , bool isEastAsia ) { int width = 0 ; foreach ( var c in value ) { width += IsFullWidth ( c , isEastAsia ) ? 2 : 1 ; } return width ; }
Get the width of the string considering EastAsianWidth by specifying whether it is East Asia.
Get the width of the string considering EastAsianWidth by specifying whether it is East Asia .
None
value
string
None
isEastAsia
bool
None