-
Flesch Readability Score is a measure of text readabilty
- Formula:
206.835 - 1.015 * (# words / # sentences) - 84.6 * (# syllables / # words)
- Formula:
-
Interned strings allow Java 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. -
Only use
==to check equality of objects. Usestr1.equals(str2)to compare values (eg in strings). -
String methods in Java:
lengthtoCharArraycharAt- return character at string positionsplitindexOf
-
For each loop in Java:
for (char c : word.toCharArray())
{
if (c == letter)
{
return true;
}
}
-
Regular Expressions:
a- matcha.a+- match one or moreas.a*- match zero or moreas.(ab)+- match one or moreabs.[abc]- match any character inside the set.[a-c]- match any character betweenaandc.[^a-c]- match anything that's not betweenaandc.a|c- matchaorc.