CSCI 1301 Lecture Notes - Lecture 4: Concatenation, American Broadcasting Company, Text Processing

28 views8 pages

Document Summary

You can go to any ta/instructor for help! Programming project 1 due on friday sept 7. If submitting late, it is a 10 point penalty per day. Multiply by 100. double num = 246. 6791; num = num * 100; Type cast to int. num_typecasted = (int) num. The + operator can be used to concatenate two or more strings together. String sentence; sentence = message + . " You can use a call to method length() anywhere an int can be used. Observe the . " notation used to invoke the object"s length() method. int count = command. length(); //in an assignment. System. out. println("length is " + command. length()); //in a print statement count = command. length() + 3; //in an expression. What are the parameters? charat indexof, lastindexof tolowercase. String message = "open the pod bay doors"; Example public class stringdemo public static void main(string[] args) String sentence = "text processing is hard! int position = sentence. indexof("hard");

Get access

Grade+20% off
$8 USD/m$10 USD/m
Billed $96 USD annually
Grade+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
40 Verified Answers
Class+
$8 USD/m
Billed $96 USD annually
Class+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
30 Verified Answers

Related Documents