Week 1 - Introduction to the Course
-
- Score is a measure of text readability
- Formula:
206.835 - 1.015 * (# words / # sentences) - 84.6 * (# syllables / # words)
- Formula:
- Score is a measure of text readability
-
- Allow the language to treat 2 duplicate strings as the same object in memory.
String text = new String("Text shiz"); # New object
String text2 = "Hello world!"; # Refers to the same "interned" object.
String text3 = "Hello world"; # Refers to the same "interned" object.
-
String methods in Java:
length
toCharArray
charAt
- return character at string positionsplit
indexOf
-
For each loop in Java:
java for (char c : word.toCharArray()) { if (c == letter) { return true; } }
-
Regular Expressions primer
a
- matcha
.a+
- match one or morea
s.a*
- match zero or morea
s.(ab)+
- match one or moreab
s.[abc]
- match any character inside the set.[a-c]
- match any character betweena
andc
.[^a-c]
- match anything that's not betweena
andc
.a|c
- matcha
orc
.