public class CharArrayUtils extends Object
Modifier and Type | Field and Description |
---|---|
static char[] |
EMPTY |
static char[][] |
EMPTY_ARRAY_OF_CHAR_ARRAYS |
static char[] |
EMPTY_CHAR_ARRAY |
Modifier and Type | Method and Description |
---|---|
static int |
compare(char[] str1,
char[] str2)
Implements a lexicographical comparator for char arrays.
|
static char[] |
concat(char[] first,
char[] second) |
static boolean |
equals(char[][] strarr1,
char[][] strarr2) |
static boolean |
equals(char[] str1,
char[] str2) |
static boolean |
equals(char[] str1,
int start1,
int length1,
char[] str2)
Returns
true if the contents of a section of a character array are the same as
contents of another character array. |
static boolean |
equals(char[] str1,
int start1,
int length1,
char[] str2,
boolean ignoreCase) |
static boolean |
equals(char[] str1,
int start1,
int length1,
String str2)
Returns
true if the contents of a section of a character array are the same as
contents of a string. |
static boolean |
equals(char[] str1,
String str2)
Returns
true if the contents of a character array are the same as contents
of a string. |
static char[] |
extract(char[] str,
int start,
int length) |
static char[] |
extractChars(StringBuilder buf)
Converts a
StringBuilder to a character array. |
static int |
hash(char[] str) |
static int |
hash(char[] str,
int start,
int length) |
static int |
indexOf(char[] toBeFound,
char[] array) |
static int |
indexOf(char[] searchFor,
char[][] searchIn)
Finds an array of chars in an array of arrays of chars.
|
static int |
indexOf(char toBeFound,
char[] array) |
static int |
indexOf(char toBeFound,
char[] buffer,
int start,
int end) |
static int |
lastIndexOf(char[] toBeFound,
char[] array) |
static int |
lastIndexOf(char[] toBeFound,
char[] array,
int fromIndex) |
static int |
lastIndexOf(char toBeFound,
char[] array) |
static int |
lastIndexOf(char toBeFound,
char[] array,
int fromIndex) |
static char[] |
lastSegment(char[] array,
char[] separator) |
static void |
overWrite(char[] buff,
int i,
char[] charImage) |
static char[] |
replace(char[] array,
char[] toBeReplaced,
char[] replacementChars) |
static boolean |
startsWith(char[] str1,
String str2)
Returns
true if a prefix of the character array is the same as contents
of a string. |
static char[][] |
subarray(char[][] array,
int start,
int end) |
static char[] |
subarray(char[] array,
int start,
int end) |
static char[] |
trim(char[] chars) |
public static final char[] EMPTY_CHAR_ARRAY
public static final char[] EMPTY
public static final char[][] EMPTY_ARRAY_OF_CHAR_ARRAYS
public static final int hash(char[] str, int start, int length)
public static final int hash(char[] str)
public static final boolean equals(char[] str1, char[] str2)
public static final boolean equals(char[][] strarr1, char[][] strarr2)
public static final boolean equals(char[] str1, String str2)
true
if the contents of a character array are the same as contents
of a string.public static final boolean equals(char[] str1, int start1, int length1, String str2)
true
if the contents of a section of a character array are the same as
contents of a string.public static final boolean startsWith(char[] str1, String str2)
true
if a prefix of the character array is the same as contents
of a string.public static final int compare(char[] str1, char[] str2)
str1
- the first of the two char arrays to comparestr2
- the second of the two char arrays to comparepublic static final boolean equals(char[] str1, int start1, int length1, char[] str2)
true
if the contents of a section of a character array are the same as
contents of another character array.public static final boolean equals(char[] str1, int start1, int length1, char[] str2, boolean ignoreCase)
public static final char[] extract(char[] str, int start, int length)
public static final char[] concat(char[] first, char[] second)
public static final char[] replace(char[] array, char[] toBeReplaced, char[] replacementChars)
public static final char[][] subarray(char[][] array, int start, int end)
public static final char[] subarray(char[] array, int start, int end)
public static final int indexOf(char toBeFound, char[] array)
public static int indexOf(char toBeFound, char[] buffer, int start, int end)
public static final int indexOf(char[] toBeFound, char[] array)
public static final int lastIndexOf(char[] toBeFound, char[] array)
public static int lastIndexOf(char toBeFound, char[] array)
public static int lastIndexOf(char toBeFound, char[] array, int fromIndex)
public static int lastIndexOf(char[] toBeFound, char[] array, int fromIndex)
public static final char[] trim(char[] chars)
public static final char[] lastSegment(char[] array, char[] separator)
public static void overWrite(char[] buff, int i, char[] charImage)
buff
- i
- charImage
- public static int indexOf(char[] searchFor, char[][] searchIn)
-1
public static char[] extractChars(StringBuilder buf)
StringBuilder
to a character array.Copyright (c) IBM Corp. and others 2004, 2020. All Rights Reserved.