パッケージ nlp4j.util

クラス StringUtils


  • public class StringUtils
    extends Object
    created_at 2021-07-24
    導入されたバージョン:
    1.3.2.0
    作成者:
    Hiroki Oya
    • コンストラクタの詳細

      • StringUtils

        public StringUtils()
    • メソッドの詳細

      • charAt

        public static String charAt​(String s,
                                    int n)
      • filter

        public static String filter​(String s,
                                    String encoding)
        Remove characters that is not covered in encoding from String
        文字エンコーディングに存在しない文字を除去します.
        パラメータ:
        s - 文字列
        encoding - エンコーディング
        戻り値:
        フィルターされた文字
      • length

        public static int length​(String s)
        Return length of string in consideration of code point.
        コードポイントを考慮した文字列長さを返します.
        パラメータ:
        s - 文字列
        戻り値:
        コードポイントを考慮した文字列長
      • substring

        public static String substring​(String s,
                                       int startIndex,
                                       int endIndex)
        created at: 2022-05-22
        パラメータ:
        s -
        startIndex - index by codePointOffset
        endIndex - index by codePointOffset
        戻り値:
      • toChars

        public static String[] toChars​(String s)
        Return String Characters in consideration of code point.
        コードポイントを考慮して1文字ずつの配列を返します.
        パラメータ:
        s - 文字列
        戻り値:
        コードポイントを考慮した文字配列
      • toCodePointArray

        public static int[] toCodePointArray​(String str)
        Convert String to code point array.
        文字列をコードポイントの配列に変換します.
        パラメータ:
        str - 文字列
        戻り値:
        コードポイントの配列
      • toHexUnicode

        public static String toHexUnicode​(char c)
        Character to Unicode in Hex String
        パラメータ:
        c - to be converted
        戻り値:
        Unicode Hex String (Same as native2ascii)
        導入されたバージョン:
        1.3.2.0
      • toHexUnicode

        public static String toHexUnicode​(String s)
        String to Unicode in Hex String
        パラメータ:
        s - to be converted
        戻り値:
        Unicode Hex String (Same as native2ascii)
        導入されたバージョン:
        1.3.2.0