Back to marketplace

Strings

No description yet. This curated deck is ready for daily study.

Total cards: 5•Content version: v3•Public deck•Updated: 8/1/2026

Card preview (5)

#1
Front (Question)

String Method: str1.equals(str2)

Back (Answer)

returns true if and only if str1 and str2 have the same values

#2
Front (Question)

str1.compareTo(str2)

Back (Answer)

returns a positive number if str1 is greater than str2 (more characters)

#3
Front (Question)

str.substring(from)

Back (Answer)

returns a substring of str starting at the from position to the end

#4
Front (Question)

str.substring(from, to)

Back (Answer)

returns str’s substring starting at the from position and up to but NOT INCLUDING the to position

#5
Front (Question)

str.indexOf(s)

Back (Answer)

returns the starting position of the first occurrence of s in str, or -1 if not found