
/*
	Tom DeDonno example on Page 87

	Added Escape character example \n

 */

public class StringDemo {

	public static void main( String[] args ) {

		String sentence = "Text processing is hard!";
		int position;

		position = sentence.indexOf( "hard" );
		System.out.println( sentence );
		System.out.println( "01234567890123456789012" );
		System.out.println( "The word \"hard\" starts at index" +
		position );

		sentence = sentence.substring( 0, position ) + "easy!";
		System.out.println( "The changed string is:" );
		System.out.println( sentence );

		System.out.println( ); System.out.println( );
		System.out.println( "Other Escape Character Examples" );
		System.out.println( "abc\\def" );
		//System.out.println( "abc\def" );
		System.out.println( "The motto is\nGo For it!" );
		System.out.println( "Tab1\tTab2\tTab3\tTab4" );
		}

} //StringDemo
