CINS-258: Web Applications Programming


Assignment Objectives & Purpose:



Original Sentence String:

" mary jones lives in santa cruz, california at 22 ocean drive."

(a.) Length Of String:
There are 66 characters (including white space) in the sentence.

(b.) Capitalize Each Word in the String:

" Mary Jones Lives In Santa Cruz, California At 22 Ocean Drive."

(c.) Change Back To Lower-Case:

" mary jones lives in santa cruz, california at 22 ocean drive."

(d.) Find & Print "Santa Cruz, California" (with Capitals):

Santa Cruz, California

(e.) Print Out the Street Address of the String:

Street Address: 22 ocean drive.
(f.) Trim White Space From Beginning Of String:
"mary jones lives in santa cruz, california at 22 ocean drive."
New Length: Now the string only has 61 characters!

(g.) Find the Index Postion of 'California'.

The index position of 'California' is: 37

(h.) Replace "Santa Cruz" with "Los Altos":

mary jones lives in Los Altos, california at 22 ocean drive."

(i.) Find the Word Count in the String:

The number of words in the sentence is 10