BBjString
Description
In BBj 7.0 and higher, the BBjString object defines an object-oriented interface to traditional BBx strings. It implements most of the methods defined by java.lang.String. This API is primarily designed to facilitate interaction with Java libraries.
Creation
BBjAPI > BBjString
All string values created in BBj are BBjStrings. To access BBjString methods, copy a BBj string value to an object variable:
string!
= "Hello world"
print
string!.length()
Methods of BBjString
Return Value |
Method |
---|---|
char |
charAt(int index) |
int |
codePointAt(int index) |
int |
codePointBefore(int index) |
int |
codePointCount(int beginIndex, int endIndex) |
int |
compareTo(string anotherString) |
int |
compareToIgnoreCase(string str) |
string |
concat(string str) |
boolean |
contains(CharSequence c) |
boolean |
contentEquals(CharSequence cs) contentEquals(StringBuffer sb) |
boolean |
endsWith(string suffix) |
boolean |
equals(Object anObject) |
boolean |
equalsIgnoreCase(string anotherString) |
byte[] |
getBytes() getBytes(string charsetName) |
void |
getBytes(int srcBegin, int srcEnd, byte[] dst, int dstBegin) |
void |
getChars(int srcBegin, int srcEnd, char[] dst, int dstBegin) |
int |
hashCode() |
string |
indent(int n) |
int |
indexOf(int ch) indexOf(int ch, int fromIndex) indexOf(string str) indexOf(string str, int fromIndex) |
string |
intern() |
boolean | isBlank() |
boolean |
isEmpty() |
int |
lastIndexOf(int ch) lastIndexOf(int ch, int fromIndex) lastIndexOf(string str) lastIndexOf(string str, int fromIndex) |
int |
length() |
boolean |
matches(string regex) |
int |
offsetByCodePoints(int index, int codePointOffset) |
boolean |
regionMatches(boolean ignoreCase, int toffset, string other, int ooffset, int len) regionMatches(int toffset, string other, int ooffset, int len) |
string |
repeat(int count) |
string |
replace(CharSequence target, CharSequence replacement) replace(char oldChar, char newChar) |
string |
replaceAll(string regex, string replacement) |
string |
replaceFirst(string regex, string replacement) |
String[] |
split(string regex) split(string regex, int limit) |
boolean |
startsWith(string prefix) startsWith(string prefix, int toffset) |
string | strip() |
string | stripIndent() |
string | stripLeading() |
string | stripTrailing() |
CharSequence |
subSequence(int beginIndex, int endIndex) |
string |
substring(int beginIndex) substring(int beginIndex, int endIndex) |
char[] |
|
string |
toLowerCase(Locale locale) |
string |
toUpperCase(Locale locale) |
string | translateEscapes() |
string |
trim() |
Remarks
None.
Constants
None.
Example
|
See Also
See the BBj Object Diagram for an illustration of the relationship between BBj Objects.