Paging from jykCodeTo make a memo.
# Region Full-width half-width conversion
/// <Summary>
/// SBC case Function)
/// </Summary>
/// <Param name = "input"> Any string </Param>
/// <Returns> Fullwidth string </Returns>
/// <Remarks>
/// The full-width space is 12288, and the half-width space is 32.
/// The correspondence between the half-width (33-126) of other characters and the full-width (65281-65374) is as follows: the difference is 65248.
/// </Remarks>
Public Static String Tosbc ( String Input)
{
// Halfwidth to fullwidth:
Char [] C = Input. tochararray ();
For ( Int I = 0 ; I < C. length; I ++ )
{
If (C [I] = 32 )
{
C [I] = ( Char ) 12288 ;
Continue ;
}
If (C [I] < 127 )
C [I] = ( Char ) (C [I] + 65248 );
}
Return New String (C );
}
/// <Summary> Function for halfwidth conversion (DBC case) </Summary>
/// <Param name = "input"> Any string </Param>
/// <Returns> Halfwidth string </Returns>
/// <Remarks>
/// The full-width space is 12288, and the half-width space is 32.
/// The correspondence between the half-width (33-126) of other characters and the full-width (65281-65374) is as follows: the difference is 65248.
/// </Remarks>
Public Static String Todbc ( String Input)
{
Char [] C = Input. tochararray ();
For ( Int I = 0 ; I < C. length; I ++ )
{
If (C [I] = 12288 )
{
C [I] = ( Char ) 32 ;
Continue ;
}
If (C [I] > 65280 && C [I] < 65375 )
C [I] = ( Char ) (C [I] - 65248 );
}
Return New String (C );
}
# Endregion