String stringOne = "Content-Type: text/html"; // substring(index) looks for the substring from the index position to the end: if (stringOne.substring(19) == "html") { }