The following text was written to the standard output stream when the StringOps.java program was executed from Netbeans.
/* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ package stringthing; /** * * @author ecuevas */ public class StringOps { /** * @param args the command line arguments */ public static void main(String[] args) { //ESTABLISH SOME STRINGS String date= "Thursday , October 11, 2018"; String time= "11:30 AM"; String lab = "String Thing"; //COMPUTE THE LENGTHS OF THE STRINGS int dateLength= date.length(); int timeLength= time.length(); int labLength=lab.length(); System.out.println("\ndateLength="+dateLength); System.out.println("timeLength="+timeLength); System.out.println("labLength="+labLength); //COMPUTE SOME POSITIONS int p1= date.indexOf(","); int p2= date.indexOf(""); int p3= lab.indexOf("ing"); System.out.println("\np1= "+ p1); System.out.println("p2= " + p2); System.out.println("p3= "+ p3); // COMPUTE SOME 2 ARGUMENT SUBSTRING VALUES System.out.println("\ndate.substring(0,9)= " + date.substring(0,9)); System.out.println("time.substring(2,4)=" + time.substring(2,4)); System.out.println("lab.substring(7,8)=" + lab.substring(7,8)); // COMPUTE SOME 1 ARGUMENT SUBSTRING VALUES System.out.println("\ndate.substring(11)= "+ date.substring(11)); System.out.println("time.substring(2)=" + time.substring(2)); System.out.println("lab.substring(7)=" + lab.substring(7)); //CREATE A STRING String line = date +" | " + time+ " | " + lab; System.out.println("\nline = " + line); } }