jp.co.ogis_ri.citk.policytool.common.util
クラス StringUtil

java.lang.Object
  上位を拡張 jp.co.ogis_ri.citk.policytool.common.util.StringUtil

public class StringUtil
extends Object

文字列のユーティリティクラス.


フィールドの概要
static String CHARSET_SHIFT_JIS
          Shift_JIS.
static String CHARSET_UTF8
          UTF-8.
static String CHARSET_WIN31J
          windows-31j.
 
メソッドの概要
static String encoding(byte[] b, String charsetName)
          バイト配列を指定されたキャラセットの文字列に変換する.
static byte[] encoding(String s, String charsetName)
          文字列を指定されたキャラセットのバイト配列に変換する.
static String shortString(String s, int length)
          指定の長さを超える文字列の場合、指定の長さで省略形の文字列に変換する.
 
クラス java.lang.Object から継承されたメソッド
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

フィールドの詳細

CHARSET_UTF8

public static final String CHARSET_UTF8
UTF-8.

関連項目:
定数フィールド値

CHARSET_SHIFT_JIS

public static final String CHARSET_SHIFT_JIS
Shift_JIS.

関連項目:
定数フィールド値

CHARSET_WIN31J

public static final String CHARSET_WIN31J
windows-31j.

関連項目:
定数フィールド値
メソッドの詳細

encoding

public static String encoding(byte[] b,
                              String charsetName)
バイト配列を指定されたキャラセットの文字列に変換する.

パラメータ:
b - バイト配列.
charsetName - キャラセット名.
戻り値:
変換した文字列.

encoding

public static byte[] encoding(String s,
                              String charsetName)
文字列を指定されたキャラセットのバイト配列に変換する.

パラメータ:
s - 文字列.
charsetName - キャラセット名.
戻り値:
変換後のバイト配列.

shortString

public static String shortString(String s,
                                 int length)
指定の長さを超える文字列の場合、指定の長さで省略形の文字列に変換する.

パラメータ:
s - 文字列.
length - 指定の文字列長.
戻り値:
変換後の文字列.


Copyright © 2011-2012 OGIS-RI Co.,Ltd.. All Rights Reserved.