|
Japanese Utils 0.3.0 |
|||||||||
前のクラス 次のクラス | フレームあり フレームなし | |||||||||
概要: 入れ子 | フィールド | コンストラクタ | メソッド | 詳細: フィールド | コンストラクタ | メソッド |
java.lang.Objectjp.osd.japanese.WidthUtils
public final class WidthUtils
全角半角変換を行うユーティリティ・クラスです。
メソッドの概要 | |
---|---|
static boolean |
isHalfWidth(char c)
指定した文字が半角文字であるかを取得します。 |
static String |
left(String src,
int width)
指定した文字列から(理論上の)幅の分だけ先頭から取得します。 |
static String |
toFullWidth(String src)
半角カタカナと ASCII 文字を全角に変換します。 |
static String |
toFullWidthAscii(String src)
空白を除く ASCII 文字を全角に変換します。 |
static String |
toFullWidthKana(String src)
半角カタカナを全角カタカナに変換します。 |
static String |
toHalfWidth(String src)
全角カタカナと字種が ASCII 文字に対応する全角文字を半角に変換します。 |
static String |
toHalfWidthAscii(String src)
字種が空白を除く ASCII 文字に対応する全角文字を半角に変換します。 |
static String |
toHalfWidthKana(String src)
全角カタカナを半角カタカナに変換します。 |
static int |
width(String src)
文字列の(理論上の)幅を取得します。 |
クラス java.lang.Object から継承されたメソッド |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
メソッドの詳細 |
---|
public static String toHalfWidth(String src)
src
- 変換対象の文字列
public static String toHalfWidthAscii(String src)
src
- 変換対象の文字列
public static String toHalfWidthKana(String src)
src
- 変換対象の文字列
public static String toFullWidth(String src)
src
- 変換対象の文字列
public static String toFullWidthAscii(String src)
src
- 変換対象の文字列
public static String toFullWidthKana(String src)
src
- 変換対象の文字列
public static int width(String src)
src
- 幅を求める対象の文字列
public static boolean isHalfWidth(char c)
c
- 半角かを調べる文字
true
public static String left(String src, int width)
String.substring(int, int)
の第 1 引数に 0 を指定したものに似ています。しかし、文字数ではなく幅(半角を 1 全角を 2 としたもの)を指定する点が異なっています。
src
- 対象の文字列width
- 取得する幅
|
Japanese Utils 0.3.0 |
|||||||||
前のクラス 次のクラス | フレームあり フレームなし | |||||||||
概要: 入れ子 | フィールド | コンストラクタ | メソッド | 詳細: フィールド | コンストラクタ | メソッド |