INSY 3433 Lecture Notes - Lecture 7: Substring, Empty String

44 views2 pages

Document Summary

Strings: class: string is a class provided by java & is a special class in java in that all objects can be represented as a string & it doesn"t need to be imported. Strings: core methods: core methods relate to a string"s contents, character in string: char charat(int index, number of characters in string: int length(, true if length is 0: boolean isempty() Strings: compare methods: comparison methods, compare 2 strings: boolean equals(string s, determines order: int comapreto(string s) Strings: partial comapre: methods comparing part of a string: boolean startswith(string s) or boolean endswith(string. Strings: substring: return part of a string, string substring(int beginindex, string substring(int beginindex, endindex) Strings: concatenating: joins 2 strings, string concat(string s, s1 + s2. Strings: returning variations: string replace(char old, char new, string touppercase(, string tolowercase(, remove leading & trailing whitespace: string trim() Strings: primitives to strings: static string valueof (type variablename)

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