Java: Delete Blanks - Solution
This page discusses - Java: Delete Blanks - Solution.
Java: Programming: Initials 2 - Answer
This page discusses - Java: Programming: Initials 2 - Answer.
Java: String Exercise 1c
This page discusses - Java: String Exercise 1c.
Java: String Exercise 1b
This page discusses - Java: String Exercise 1b.
Java: String Exercise 1a
This page discusses - Java: String Exercise 1a.
This page discusses - Java: TokenizeExpr.java.
Java: Regex Exercises 1
This page discusses - Java: Regex Exercises 1.
Java: Example - Count occurences
Problem: Count the number of times one string is found in another..
Java: Example - String sort
Java: Example - String sort.
Java: Example - Palindrome test
Java: Example - Palindrome test.
Java: Example - Change Extension
Problem: Change the extension of a file name.
Java: Example - Count vowels
This example method counts all vowels (a, e, i, o, u) in a string..
Java: Example - Words to array
Java: Example - Words to array.
Java: String Exercise 2
String Exercise 2.
Exercise - Trim Right
Write a method that returns a string with all trailing blanks from the right end of its string parameter..
Programming - reverse() method
Write a method which has one parameter, a string, which returns a string which is the parameter will all characters reversed..
Programming - Replace method
The predefined Java function replace may not be used for this -- you have to write it yourself..
Exercise - Palindrome
Write a method which returns true if the string parameter is a palindrome..
Exercise - Pad Left
Write a method to return a string which is the parameter with add extra blanks to the left end to make it length width..
Programming - max3() method
Write a method which has three double parameters and returns the largest value..
Exercise - Count Words
Write a method which counts the number of words in a string..
Programming - countVowels() method
Write a method which has one parameter, a string, and it returns the int number of vowels (a e i o u) in the string..
Programming - Count Vowels - main
Write a program that reads a string and displays the number of vowels in it..
Exercise - Count Words
Write a method which counts the number of words in a string. Assume that a word is defined as a sequence of letters..
Exercise - Delete Blanks
Write a method to delete all blanks from its parameter..
Programming - World Peace
Change all occurences of "war" to "peace".
Programming: Initials 2
Write a program that asks for a name, including both first and last name, and displays the initials..
Programming: Initials 1
Write a program that asks for names and displays the initials..
Programming - Transform Name
Write a program to redisplay a name, possibly transformed.
Programming - Transform Name - Answer
Solution to: Write a program to redisplay a name, possibly transformed..
Programming - Transform Name - GUI 0
Write a GUI program to redisplay a name, possibly transformed..
Capitalize - Solution
Capitalize programming exercise..
Exercise - Capitalize
Write a method, capitalize, which takes one string parameter and returns a string ..
Exercise - Capitalize Words
Write a method which which returns a string first letter in every word capitalized and every other letter in lowercase..
Programming - Flip Name
Write a method, flipName, which has a string parameter which contains a name in last, first format..
String Exercises 1
(10 points) Given the following local variable declarations:.
String Exercise 2 - Answers
Assume the following:> String s, t, h, a; String n, e.
String Exercises 1 - Answers
Answers to the String Exercises 1..
Converting Strings to Numbers
To convert a string value to a number (for example, to convert the String value in a text field to an int), use these methods.
Converting Numbers to Strings
Converting Anything to String describes how to convert objects to String..
Converting Anything to String
Converting any data to strings is easy..
Example - Replace word
Write a method to replaces all occurences a word in a string with another word..
Example - Display Extension
This program reads in a file name and displays the extension (that last part of the name after the final dot)..
Example - Array to String
Program to concatenate all of the strings in an array, each separated by a specifed string separater..
Example - SortWords3.java
This program takes a string in one text field..
When tokenizing a string, the delimiters are ignored by default..
A StringTokenizer constructor takes a string to break into tokens and returns a StringTokenizer object for that string..
Regex Language Intro
These fundamental regex elements apply to all implemenations, and will solve most or your regex needs..
Finding the domain name in HTML links..
Regex Exercises 2
Regular expressions do not have to be written as Java strings (eg, no Java string escape for the '\')..