Browse by Topic

Popular

Latest

Latest Java Posts

Java String replaceAll regex replacement concept with a magnifying glass over text
Java

Java String replaceAll: Regex Replacement and Pitfalls

Learn how to use Java's String.replaceAll() for regex-based replacement, including escaping, performance, and common mistakes.

JavaStringRegular ExpressionsreplaceAll
A Java String being transformed by the replace method, showing literal text substitution without regular expression pattern matching.
Java

Java String replace: Literal Replacement Without Regex

java string replace: How Java's String.replace() works, how it differs from replaceAll() and replaceFirst(), and when to choose literal replacement over regex.

JavaStringreplaceregex
Diagram comparing Java string join methods with delimiter and list elements.
Java

Java String Join: Methods and Examples

java string join: Learn how to join strings in Java using String.join, Collectors.joining, StringJoiner, and StringBuilder, with practical examples and tradeoffs.

String.joinCollectors.joiningStringJoinerStringBuilder
Illustration of splitting a Java string into an array using the split method with regex and limit parameters.
Java

Java String split: Syntax, Edge Cases, and Performance

java string split: Learn how Java String.split works, including regex syntax, the limit parameter, trailing empty string behavior, and performance tradeoffs.

javastring-splitregexperformance
Illustration of a Java string being split into a substring with index markers and a memory copy icon
Java

java string substring: Syntax, Edge Cases, and Memory Behavior

Learn the two String.substring overloads, how Java interprets start and end indexes, when exceptions occur, and why substring copies memory in modern Java.

JavaString APISubstringIndex Handling
Illustration of Java String charAt method showing a character being extracted from a string at a specific index.
Java

Java String charAt: Syntax, Edge Cases, and Performance

Learn how to use Java's String.charAt() method: syntax, bounds checking, performance, and Unicode limitations.

JavaStringcharAtStringIndexOutOfBoundsException
Diagram comparing Java string length in code units vs code points for emoji characters
Java

Java String Length: Code Units vs Code Points

Understand how Java's String.length() counts UTF-16 code units, why that differs from visible characters, and when to use codePointCount() for Unicode-aware measurement.

JavaStringUnicodecodePointCount
A diagram showing multiple Java string concatenation paths converging into a single efficient StringBuilder result.
Java

Java String Concat: Choosing the Right Approach

java string concat: Compare Java string concatenation options: the + operator, concat(), StringBuilder, and String.join. Learn which approach fits each scenario.

String ConcatenationStringBuilderJava PerformanceString API
Illustration of Java string concatenation showing different methods like +, StringBuilder, and StringBuffer.
Java

Java + String Concatenation: Choosing the Right Approach

Learn how Java handles string concatenation, compare +, concat(), StringBuilder, and StringBuffer, and choose the right approach for performance and readability.

StringBuilderStringBufferJava StringsString Concatenation
Diagram showing Java string concatenation options with a plus sign, a StringBuilder object, and a chain of characters.
Java

Java String Concatenation: Choose the Right Method

java string concatenation: Learn how Java string concatenation works, why String immutability matters, and when to use StringBuilder or the + operator for efficient code.

StringBuilderString immutabilityJava performanceString handling