Personal tools
You are here: Home Members mpate1's Home StringClass
Document Actions

StringClass

by Mit Patel last modified 2006-03-22 12:04 AM

Descriptions for methods of String Class. This will help you do the part one of the assignment.

Type, Method: Description

char, charAt(int index): Returns the character at the given string index.

int, compareTo(String anotherString): Compares a string to another string.

String, concat(String str): Joins two strings.

boolean, equals(Object anObject): Compares a string to another object.

boolean, equalsIgnoreCase(String anotherString): Compares a string to another object with no regard for upper- or lowercase.

int, indexOf(String str): Finds the index of the first occurrence of a given character or substring in a string.

int, lastIndexOf(int ch): Finds the index of the last occurrence of a given character or substring in a string.

int, length(): Returns the length of a string.

String, replace(char oldChar, char newChar): Replaces all occurrences of a given character with a new character.

boolean, startsWith(String prefix): Checks a string for the given prefix.

String, substring(int beginIndex, int endIndex): Returns a substring of a string.

String, toLowerCase(): Converts all characters in the string to lowercase.

String, toUpperCase(): Converts all characters in the string to uppercase.

String, trim(): Removes whitespace characters from the beginning and end of a string.

static String, valueOf(int i): Returns a string representation of an int argument.

RemainingStringClass for the curious. The most important ones are the ones listed here for the purpose of the lab9.


Powered by Plone CMS, the Open Source Content Management System

This site conforms to the following standards: