HOME      BLOG       FORUMS      CONTACT       ABOUT

Finds out the capacity of a StringBuffer

April 20th, 2008 Albin Joseph Posted in java.lang No Comments »

public class StringBufferExample {
	public static void main(String[] args) {
		StringBuffer buff = new StringBuffer(100);
		buff.append("Hello World");
		int value = buff.capacity();

		System.out.println(value);
	}
}
Share
AddThis Social Bookmark Button

Finds out the length of a StringBuffer

April 20th, 2008 Albin Joseph Posted in java.lang No Comments »

public class StringBufferExample {
	public static void main(String[] args) {
		StringBuffer buff = new StringBuffer("Hello World");
		int length = buff.length();

		System.out.println(length);
	}
}
Share
AddThis Social Bookmark Button

Creates a StringBuffer from a String

April 20th, 2008 Albin Joseph Posted in java.lang No Comments »

public class StringBufferExample {
	public static void main(String[] args) {
		StringBuffer buff = new StringBuffer("Hello World");

		System.out.println(buff);
	}
}
Share
AddThis Social Bookmark Button

Creates a StringBuffer with an initial capacity

April 20th, 2008 Albin Joseph Posted in java.lang No Comments »

public class StringBufferExample {
	public static void main(String[] args) {
		StringBuffer buff = new StringBuffer(100);

		System.out.println(buff);
	}
}
Share
AddThis Social Bookmark Button

Converts a string to character array

April 19th, 2008 Albin Joseph Posted in java.lang No Comments »

public class StringExample {
	public static void main(String[] args) {
		String str=" Hello World ";
		char value[] = str.toCharArray();

	}
}
Share
AddThis Social Bookmark Button

Converts a string to upper case according to a locale

April 19th, 2008 Albin Joseph Posted in java.lang No Comments »

public class StringExample {
	public static void main(String[] args) {
		String str=" Hello World ";
		String value = str.toUpperCase(Locale.getDefault());

		System.out.println(value);
	}
}
Share
AddThis Social Bookmark Button

Converts a string to lower case according to a locale

April 19th, 2008 Albin Joseph Posted in java.lang No Comments »

import java.util.Locale;

public class StringExample {
	public static void main(String[] args) {
		String str=" Hello World ";
		String value = str.toLowerCase(Locale.getDefault());

		System.out.println(value);
	}
}
Share
AddThis Social Bookmark Button

Trims a string

April 19th, 2008 Albin Joseph Posted in java.lang No Comments »

public class StringExample {
	public static void main(String[] args) {
		String str=" Hello World ";
		String value = str.trim();

		System.out.println(value);
	}
}
Share
AddThis Social Bookmark Button

Converts a string to upper case

April 19th, 2008 Albin Joseph Posted in java.lang No Comments »

public class StringExample {
	public static void main(String[] args) {
		String str="Hello World";
		String value = str.toUpperCase();

		System.out.println(value);
	}
}
Share
AddThis Social Bookmark Button

Converts a string to lower case

April 19th, 2008 Albin Joseph Posted in java.lang No Comments »

public class StringExample {
	public static void main(String[] args) {
		String str="Hello World";
		String value = str.toLowerCase();

		System.out.println(value);
	}
}
Share
AddThis Social Bookmark Button