Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Sv translation
languageen

The complete reference of string amnipulating functions

capitalize(str)

Capitalizes a String changing the first letter to title case as per Character.toTitleCase(char).

center(str, int size)

Centers a String in a larger String of size size using the space character (' ').

center(str, int size, String padStr)

Centers a String in a larger String of size size.

chomp(str)

Removes one newline from end of a String if it's there, otherwise leave it alone.

chomp(str, String separator)

Removes separator from the end of str if it's there, otherwise leave it alone.

chop(str)

Remove the last character from a String.

boolean contains(str, String searchStr)

Checks if String contains a search String, handling null.

boolean containsIgnoreCase(str, String searchStr)

Checks if String contains a search String irrespective of case, handling null.

boolean containsNone(str, String invalidChars)

Checks that the String does not contain certain characters.

boolean containsOnly(str, String validChars)

Checks if the String contains only certain characters.

int countMatches(str, String sub)

Counts how many times the substring appears in the larger String.

deleteWhitespace(str)

Deletes all whitespaces from a String.

difference(str1, String str2)

Compares two Strings, and returns the portion where they differ.

boolean equals(str1, String str2)

Compares two Strings, returning true if they are equal.

boolean equalsIgnoreCase(str1, String str2)

Compares two Strings, returning true if they are equal ignoring the case.

int getLevenshteinDistance(s, String t)

Find the Levenshtein distance between two Strings.

int indexOf(str, String searchStr)

Finds the first index within a String, handling null.

int indexOf(str, String searchStr, int startPos)

Finds the first index within a String, handling null.

int indexOfAny(str, String searchChars)

Search a String to find the first index of any character in the given set of characters.

int indexOfAny(str, String[] searchStrs)

Find the first index of any of a set of potential substrings.

int indexOfAnyBut(str, String searchChars)

Search a String to find the first index of any character not in the given set of characters.

int indexOfDifference(str1, String str2)

Compares two Strings, and returns the index at which the Strings begin to differ.

boolean isAlpha(str)

Checks if the String contains only unicode letters.

boolean isAlphanumeric(str)

Checks if the String contains only unicode letters or digits.

boolean isAlphanumericSpace(str)

Checks if the String contains only unicode letters, digits or space (' ').

boolean isAlphaSpace(str)

Checks if the String contains only unicode letters and space (' ').

boolean isBlank(str)

Checks if a String is whitespace, empty ("") or null.

boolean isEmpty(str)

Checks if a String is empty ("") or null.

boolean isNotBlank(str)

Checks if a String is not empty (""), not null and not whitespace only.

boolean isNotEmpty(str)

Checks if a String is not empty ("") and not null.

boolean isNumeric(str)

Checks if the String contains only unicode digits.

boolean isNumericSpace(str)

Checks if the String contains only unicode digits or space (' ').

boolean isWhitespace(str)

Checks if the String contains only whitespace.

join(String[] array)

Joins the elements of the provided array into a single String containing the provided list of elements.

join(String[] array, String separator)

Joins the elements of the provided array into a single String containing the provided list of elements.

join(String[] array, String separator, int startIndex, int endIndex)

Joins the elements of the provided array into a single String containing the provided list of elements.

int lastIndexOf(str, String searchStr)

Finds the last index within a String, handling null.

int lastIndexOf(str, String searchStr, int startPos)

Finds the first index within a String, handling null.

int lastIndexOfAny(str, String[] searchStrs)

Find the latest index of any of a set of potential substrings.

left(str, int len)

Gets the leftmost len characters of a String.

leftPad(str, int size)

Left pad a String with spaces (' ').

leftPad(str, int size, String padStr)

Left pad a String with a specified String.

lowerCase(str)

Converts a String to lower case as per String.toLowerCase().

length(str)

This will return the no. of characters of the string.

mid(str, int pos, int len)

Gets len characters from the middle of a String.

int ordinalIndexOf(str, String searchStr, int ordinal)

Finds the n-th index within a String, handling null.

overlay(str, String overlay, int start, int end)

Overlays part of a String with another String.

remove(str, String remove)

Removes all occurances of a substring from within the source string.

removeEnd(str, String remove)

Removes a substring only if it is at the end of a source string, otherwise returns the source string.

removeStart(str, String remove)

Removes a substring only if it is at the begining of a source string, otherwise returns the source string.

repeat(str, int repeat)

Repeat a String repeat times to form a new String.

replace(text, String repl, String with)

Replaces all occurrences of a String within another String.

replace(text, String repl, String with, int max)

Replaces a String with another String inside a larger String, for the first max values of the search String.

replaceChars(str, String searchChars, String replaceChars)

Replaces multiple characters in a String in one go.

replaceOnce(text, String repl, String with)

Replaces a String with another String inside a larger String, once.

reverse(str)

Reverses a String as per StringBuffer.reverse().

right(str, int len)

Gets the rightmost len characters of a String.

rightPad(str, int size)

Right pad a String with spaces (' ').

rightPad(str, int size, String padStr)

Right pad a String with a specified String.

String[] split(str)

Splits the provided text into an array, using whitespace as the separator.

String[] split(str, String separatorChars)

Splits the provided text into an array, separators specified.

String[] split(str, String separatorChars, int max)

Splits the provided text into an array with a maximum length, separators specified.

String[] splitByWholeSeparator(str, String separator)

Splits the provided text into an array, separator string specified.

String[] splitByWholeSeparator(str, String separator, int max)

Splits the provided text into an array, separator string specified.

String[] splitPreserveAllTokens(str)

Splits the provided text into an array, using whitespace as the separator, preserving all tokens, including empty tokens created by adjacent separators.

String[] splitPreserveAllTokens(str, String separatorChars)

Splits the provided text into an array, separators specified, preserving all tokens, including empty tokens created by adjacent separators.

String[] splitPreserveAllTokens(str, String separatorChars, int max)

Splits the provided text into an array with a maximum length, separators specified, preserving all tokens, including empty tokens created by adjacent separators.

strip(str)

Strips whitespace from the start and end of a String.

strip(str, String stripChars)

Strips any of a set of characters from the start and end of a String.

String[] stripAll(String[] strs)

Strips whitespace from the start and end of every String in an array.

String[] stripAll(String[] strs, String stripChars)

Strips any of a set of characters from the start and end of every String in an array.

stripEnd(str, String stripChars)

Strips any of a set of characters from the end of a String.

stripStart(str, String stripChars)

Strips any of a set of characters from the start of a String.

substring(str, int start)

Gets a substring from the specified String avoiding exceptions.

substring(str, int start, int end)

Gets a substring from the specified String avoiding exceptions.

substringAfter(str, String separator)

Gets the substring after the first occurrence of a separator.

substringAfterLast(str, String separator)

Gets the substring after the last occurrence of a separator.

substringBefore(str, String separator)

Gets the substring before the first occurrence of a separator.

substringBeforeLast(str, String separator)

Gets the substring before the last occurrence of a separator.

substringBetween(str, String tag)

Gets the String that is nested in between two instances of the same String.

substringBetween(str, String open, String close)

Gets the String that is nested in between two Strings.

String[] substringsBetween(str, String open, String close)

Searches a String for substrings delimited by a start and end tag, returning all matching substrings in an array.

swapCase(str)

Swaps the case of a String changing upper and title case to lower case, and lower case to upper case.

trim(str)

Removes control characters (char <= 32) from both ends of this String, handling null by returning null.

uncapitalize(str)

Uncapitalizes a String changing the first letter to title case.

upperCase(str)

Converts a String to upper case.

Sv translation
languageja

文字列操作関数の完全なリファレンス 

capitalize(str)

文字列Character.toTitleCase(char型)あたりとして表題のケースに最初文字を変更することを大文字にします。

center(str, int size)

( '')空白文字を使用することでサイズサイズの大きな文字で文字列を中央に配置されます。

center(str, int size, String padStr)

サイズのサイズの大きな文字で文字列を中央に配置されます。

chomp(str)

それがあれば文字列の末尾から1つの新行を削除する。そうでない場合は単独でそれを残します。

chomp(str, String separator)

それがあれば文字列の末尾から. セパレーターを削除する。そうでない場合は単独でそれを残します。

chop(str)

文字列から最後の文字を削除します。

boolean contains(str, String searchStr)

検索文字列が含まれている場合、チェック文字列がnullで処理します。

boolean containsIgnoreCase(str, String searchStr)

文字分類なく検索文字列が含まれている場合、チェック文字列がnullで処理します。

boolean containsNone(str, String invalidChars)

特定の文字が含まれていない文字列をチェックします。

boolean containsOnly(str, String validChars)

特定の文字のみが含まれている場合、チェックします

int countMatches(str, String sub)

サブストリングが長い文字列で表示された回数をカウントします。

deleteWhitespace(str)

文字列からすべての空白を削除します。

difference(str1, String str2)

2つの文字列を比較し、それらが異なる位置を返却します。

boolean equals(str1, String str2)

2つの文字列を比較し、それらが等しい場合は「true」を返却します。

boolean equalsIgnoreCase(str1, String str2)

2つの文字列を比較し、ケースを無視してイコールである場合は「true」を返却します。

int getLevenshteinDistance(s, String t)

2つの文字列の間のレーベンシュタイン距離を見つけます。

int indexOf(str, String searchStr)

文字列での最初のインデックスを検索し、「null」で処理します。

int indexOf(str, String searchStr, int startPos)

文字列での最初のインデックスを検索し、「null」で処理します。

int indexOfAny(str, String searchChars)

文字の与えられたセットでの任意の文字の最初のインデックスを見つけるために、文字列を検索します。

int indexOfAny(str, String[] searchStrs)

潜在的なストリングのセットのいずれかの最初のインデックスを検索します。

int indexOfAnyBut(str, String searchChars)

与えられた文字セットでない任意の文字の最初のインデックスを見つけるために文字列を検索します。

int indexOfDifference(str1, String str2)

2つの文字列を比較し、文字列が異なるし始めるインデックスを返却します。

boolean isAlpha(str)

文字列がユニコード文字のみが含まれている場合、チェックします。

boolean isAlphanumeric(str)

文字列がユニコード文字や数字のみが含まれている場合、チェックします。

boolean isAlphanumericSpace(str)

文字列がユニコード文字、数字と('')スペースのみが含まれている場合、チェックします。

boolean isAlphaSpace(str)

文字列がユニコード文字と('')スペースのみが含まれている場合、チェックします。

boolean isBlank(str)

文字列が空白空("")またはnullの場合、チェックします

boolean isEmpty(str)

文字列が空("")またはnullである場合、チェックします。

boolean isNotBlank(str)

文字列が空("")でない場合、nullでないと空白ではないのみチェックします

boolean isNotEmpty(str)

文字列が空("")でないとnullでない場合、チェックします

boolean isNumeric(str)

文字列がUnicodeの数字のみが含まれているかどうかをチェックする。

boolean isNumericSpace(str)

文字列がUnicodeの数字またはスペース('')のみが含まれている場合にチェックします

boolean isWhitespace(str)

文字列が空白のみが含まれている場合にチェックします

join(String[] array)

要素の提供リストを含む単一の文字列に設けられた配列の要素を統合します。

join(String[] array, String separator)

要素の提供リストを含む単一の文字列に設けられた配列の要素を統合します。

join(String[] array, String separator, int startIndex, int endIndex)

要素の提供リストを含む単一の文字列に設けられた配列の要素を統合します。

int lastIndexOf(str, String searchStr)

文字列での最後のインデックスを検索し、nullで処理します。

int lastIndexOf(str, String searchStr, int startPos)

文字列での最初のインデックスを検索し、nullで処理します。

int lastIndexOfAny(str, String[] searchStrs)

潜在的なストリングのセットのいずれかの最新のインデックスを検索します。

left(str, int len)

文字列の左端のn文字を取得します。

leftPad(str, int size)

パッドをスペース('')で文字列を残します。

leftPad(str, int size, String padStr)

指定された文字列を持つ文字列は、パッドを残します。

lowerCase(str)

文字列をString.toLowerCase()通りに小文字に変換します.

length(str)

これは文字列のNoを返却します。

mid(str, int pos, int len)

文字列の途中からlen文字を取得します。

int ordinalIndexOf(str, String searchStr, int ordinal)

文字列内のn番目のインデックスを検索し、nullで処理します。

overlay(str, String overlay, int start, int end)

別の文字列で文字列の一部オーバーレイします

remove(str, String remove)

ソース文字列内からサブストリングのすべての発生を削除します。

removeEnd(str, String remove)

それは元の文字列の末尾にある場合のみに、部分文字列を削除する。それ以外の場合は元の文字列を返却します。

removeStart(str, String remove)

それは元の文字列の先頭にある場合のみに、部分文字列を削除する。それ以外の場合は元の文字列を返却します。

repeat(str, int repeat)

新文字列を形成するために、文字列の繰り返し回数を繰り返却します。

replace(text, String repl, String with)

別の文字列内の文字列のすべての出現回を置き換える。

replace(text, String repl, String with, int max)

検索文字列の最初の最大値に対して、より大きな文字列内部文字列を別の文字列で置き換えます。

replaceChars(str, String searchChars, String replaceChars)

一度に文字列に複数の文字を交換します。

replaceOnce(text, String repl, String with)

一度、より大きな文字列の内側に文字列を別の文字列で置き換えます。

reverse(str)

StringBuffer.reverse()ごとに文字列を反転させます

right(str, int len)

文字列の右端のlen文字を取得ます

rightPad(str, int size)

スペース('')を持つ文字列の右パッド

rightPad(str, int size, String padStr)

指定されたStringを持つ文字列の右パッド

String[] split(str)

セパレータとして空白を使用して、配列に提供されたテキストを分割します。

String[] split(str, String separatorChars)

配列に提供されたテキストを分割し、セパレータは指定されます。

String[] split(str, String separatorChars, int max)

最大の長さを持つ配列に提供されたテキストを分割し、セパレータは指定されます。

String[] splitByWholeSeparator(str, String separator)

指定された配列、区切り文字列に提供されたテキストを分割します。

String[] splitByWholeSeparator(str, String separator, int max)

指定された配列、区切り文字列に提供されたテキストを分割します。

String[] splitPreserveAllTokens(str)

配列に提供されたテキストを分割し、セパレータとして空白を使用し、隣接するセパレータで作成した空のトークンを含むすべてのトークンを保存します。

String[] splitPreserveAllTokens(str, String separatorChars)

セパレータ指定、配列に提供されたテキストを分割し、隣接するセパレータで作成した空のトークンを含むすべてのトークンを保存します。

String[] splitPreserveAllTokens(str, String separatorChars, int max)

セパレータ指定、最大の長さを持つ配列に提供されたテキストを分割し、隣接するセパレータで作成した空のトークンを含むすべてのトークンを保存します。

strip(str)

文字列の先頭と末尾から空白を取り除きます。

strip(str, String stripChars)

文字列の先頭と末尾から文字のセットのいずれかを取り除きます。

String[] stripAll(String[] strs)

配列内のすべての文字列の先頭と末尾から空白を取り除きます。

String[] stripAll(String[] strs, String stripChars)

配列内のすべての文字列の先頭と末尾から文字のセットのいずれかを取り除きます。

stripEnd(str, String stripChars)

文字列の末尾から文字のセットのいずれかを取り除きます。

stripStart(str, String stripChars)

文字列の先頭から文字のセットのいずれかを取り除きます。

substring(str, int start)

例外を回避し、指定された文字列から部分文字列を取得します。

substring(str, int start, int end)

例外を回避し、指定された文字列から部分文字列を取得します。

substringAfter(str, String separator)

セパレータの最初の出現回の後の部分文字列を取得します。

substringAfterLast(str, String separator)

セパレータの最後の出現回の後の部分文字列を取得します。

substringBefore(str, String separator)

セパレータの最初の出現の文字列前に列を取得します。

substringBeforeLast(str, String separator)

セパレータの最後の出現の文字列前に列を取得します。

substringBetween(str, String tag)

同じ文字列の2つのインスタンスの間でネストされている文字列を取得します。

substringBetween(str, String open, String close)

二つの文字列の間にネストされている文字列を取得します。

String[] substringsBetween(str, String open, String close)

開始タグと終了タグによって区切られた部分文字列のための文字列を検索し、配列内のすべての一致するサブストリングを返却します。

swapCase(str)

大文字に、文字ごとの大文字を小文字に、小文字を大文字に変更することで文字列文字のタイプをれ替えます。

trim(str)

この文字列の両端から制御文字を(文字<=32)を削除し、nullを返すことによって、null処理します。

uncapitalize(str)

タイトルケースへの最初の文字を変更することで文字列の大文字にすることをキャンセルします。

upperCase(str)

文字列を大文字に変換します。