![]() ![]() ![]() ![]() |
| Topics this page:
|
|
|
Peter van der Linden, in his Expert C Programming: Deep Secrets (SunSoft/Prenticd Hall, 1994, ISBN 0131774298) notes that strlen() doesn't include the null character because a correction in an early version of the ANSI C standard didn't get carried over. Robert Seacord, in his "Secure Coding in C and C++: Strings" Addison Wesley Professional book 0321335724 published Dec 1, 2005, provides example coding. | ![]() ![]() ![]() |
| ![]() ![]() ![]() |
| ![]() ![]() ![]() |
| ![]() ![]() |
|
Return DataType ![]() | Method | Parameter List | Description |
---|---|---|---|
int | length() | str | Returns the length (character count) of this string buffer |
char | charAt() | int location_index | Extract a single character. char charAt(int index); |
String | substring() | int startIndex, int endIndex | Return the substring from the starting index up to but not including the ending index. |
String | substring() | int start | Returns a new string that contains a sub-sequence of characters currently contained in this StringBuffer The sub-string begins at the specified index and extends to the end of the StringBuffer |
String | substring() | int start, int end | Returns a new string that contains a sub-sequence of characters currently contained in this StringBuffer |
|
Return DataType ![]() | Method | Parameter List | Description |
---|---|---|---|
boolean | endsWith() | String string_to_match | Determines if the string ends with the string_to_match. |
int | indexOf() | String sub_string | Determines location of first occurence of substring. You get a-1 if it does not exist. |
int | lastIndexOf() | String sub_string | Determines location of last occurrence of substring. You get a-1 if it does not exist. |
String | replace() | char originalChar, char replacementChar | Replaces an existing character with another. |
boolean | startsWith() | String, string_to_match | Determines if the string starts with the string_to_match. |
String | concat() | String str | Concatenate the specified string to the end of this string |
String | toLowerCase() | None | Converts the string to lowercase. |
String | None | Converts the string to uppercase. | |
String | trim() | None | Removes leading and trailing spaces. |
String | compareTo() | String, string_to_match | compares two strings lexicographically |
String | compareToIgnoreCase() | String, string_to_match | compares two strings lexicographically, ignoring case considerations |
| ![]() ![]() ![]() |
| ![]() ![]() ![]() |
| ![]() ![]() ![]() |
| ![]() ![]() ![]() |
| ![]() ![]() ![]() |
| ![]() ![]() ![]() |
Related Topics:
![]() | Your first name: Your family name: Your location (city, country): Your Email address: |
Top of Page ![]() Thank you! |