CSC 120 Lecture 11: String Methods

40 views7 pages
Verified Note

Document Summary

In java string has many methods, and they all have similar for which is: Each element in char is assigned a unique 16-bit nonnegative whole number (0 - 65535) The numbers assigned to "0" - "9" are consecutive (48 - 57) The numbers assigned to "a" - "z" are consecutive (65 - 90) The numbers assigned to "a" - "z" are consecutive (97 - 122) Returns int value of string length. (position starts with 0. Returns char at position int. (position starts with 0. Returns the position of first match of a in string name. (if there is no match returns -1: name. lastindexof(a) Returns the position of last match of a in string name. (if there is no match returns -1: name. indexof(a, z) Returns the position of first match of a in string name after position z. (if there is no match returns -1: name. lastindexof(a, z)

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

Related Questions