All syntax guides
Short, practical guides on programming syntax, language fundamentals, and the tools developers reach for every day.
3,980 guides across 14 topics
Topics
Popular guides
Most readLatest guides
Page 301 of 398Java String equals: Compare Strings Correctly
java string equals: Learn how to compare strings in Java using equals, equalsIgnoreCase, and related methods, and avoid common pitfalls with == and null handling.
Java String toLowerCase: Usage and Locale Pitfalls
Understand how Java's String.toLowerCase() works, why the no-argument version uses the default locale, and when to pass an explicit Locale for deterministic case conversion.
Java String toUpperCase(): Usage, Locale, and Edge Cases
Learn how Java's String.toUpperCase() works, why locale matters, and how to avoid common pitfalls with case conversion in production code.
Java trim vs strip: Key Differences Explained
Understand the difference between Java's trim() and strip() methods, including Unicode whitespace handling, performance, and when to use each.
Java String strip: Removing Unicode Whitespace
Learn how Java's String.strip() removes Unicode whitespace, how it differs from trim(), and when to use each method in practice.
Java String trim: Remove Leading and Trailing Whitespace
Java's String.trim() removes leading and trailing ASCII whitespace. See how it works, its edge cases, and how it differs from strip() in Java 11+.
Java String lastIndexOf: Usage and Edge Cases
Learn how to use Java String lastIndexOf effectively: overloads, backward search behavior, fromIndex handling, edge cases, and performance considerations.
Java String indexOf: Usage and Edge Cases
Learn how Java's String.indexOf() searches for characters and substrings, returns -1 for missing matches, and handles overloads and edge cases.
Java String endsWith: Syntax, Edge Cases, Performance
Learn how Java's String.endsWith() method checks suffixes: syntax, case sensitivity, null and empty suffixes, case-insensitive alternatives, and performance tradeoffs.
Java String startsWith: Syntax and Common Pitfalls
java string startswith: Learn how to use Java String startsWith for prefix checks, including offset, case sensitivity, edge cases, and performance considerations.