Understanding Java's String Class and Regular Expressions
The String Constant Pool
Java's String Constant Pool is a specialized memory area designed to store string literals, optimizing memory usage and performance. Its location has evolved across Java versions.
Key Characteristics of the String Pool
Storage Location: In Java 6 and earlier, the pool resided in the PermGen (Permanent Generation). Star ...
Posted on Sun, 17 May 2026 05:04:04 +0000 by travelbuff
Suffix Array Construction and Applications
A suffix array is a compact representation of all suffixes of a string, sorted lexicographically. Constructing this array efficiently is foundational for various string processing tasks.
Construction via Prefix Doubling
To construct the suffix array in $O(n \log n)$ time, we use a prefix doubling strategy cobmined with Radix Sort. We iterativel ...
Posted on Sat, 16 May 2026 18:59:23 +0000 by eaglelegend
Essential String Manipulation Functions in C#
In C#, the string type is an alias for System.String. String literals must be enclosed in double quotes.
string siteAddress = "www.devsiki.com";
To obtain the length of a string, use the Length property.
int charCount = siteAddress.Length;
String equality can be checked using the == operator.
if (siteAddress == "www.devsiki.com ...
Posted on Sat, 16 May 2026 02:20:35 +0000 by son.of.the.morning
Essential Java APIs: String Handling, Collections, Dates, and Generics
Core API Concepts
Object & String Fundamentals
By default, the toString() method in the Object class returns the memory address (hash) of the object, which is often not useful. It is standard practice to override this method to return a string representation of the object's internal state.
The == operator compares primitive types by value, ...
Posted on Fri, 15 May 2026 17:35:22 +0000 by m00nz00mer
Java Basics: Characters and Strings
The char data type is used to represent a single character. Character literals are enclosed in single quotes. ```
char a = 'A';
char b = '4';
char c = '\u041'; // Unicode for A
String literals must be enclosed in double quotes, while character literals are single characters enclosed in single quotes. Thus, "A" is a string, and 'A' is ...
Posted on Fri, 15 May 2026 15:18:46 +0000 by davey_b_
L-Shaped String Transformation
Given a string s and a number of rows numRows, arrange the string in an L-shaped pattern from top to bottom, left to right. Then, read the characters row by row from left to right to produce a new string. Implement this transformation with the function signature:
transform(s: string, numRows: number) => string
For example, with input string ...
Posted on Thu, 14 May 2026 21:23:58 +0000 by LDusan
A Comprehensive Guide to String Operations in C and C++
Understanding String Manipulation in C and C++
Strings are fundamental data types in programming, representing sequences of characters. Both C and C++ offer robust mechanisms for handling strings, though their approaches differ significantly. C primarily relies on null-terminated character arrays and a library of functions, while C++ introduces ...
Posted on Wed, 13 May 2026 18:27:30 +0000 by gwbouge
Validating Balanced Parentheses in Strings
Given a string s containing only the characters '(', ')', '{', '}', '[', and ']', determine if the string is valid. A valid string satisfies:
Every opening bracket must be closed by a matcihng bracket of the same type.
Brackets must close in the correct order.
Each closing bracket croresponds to an opening bracket of the same type.
Example 1: ...
Posted on Wed, 13 May 2026 17:47:57 +0000 by joaca
Three-Point Search and Substring Analysis for AtCoder ABC 043
Problem A
Compute the sum \(\sum_{i=1}^{n} i = \binom{n+1}{2}\).
Problem B
Statement:
Given a string, process it from left to right. Whenever a character B is encountered, it removes itself and the character immediately to its right (if any). Output the final remaining string.
Solution:
Use a stack-like approach: iterate over the input and push ...
Posted on Wed, 13 May 2026 10:36:54 +0000 by jswinkelman
Java String Manipulation and Numeric Formatting Techniques
This article demonstrates practical Java methods for string processing and number formatting operations.
Detecting Chinese Characters in Strings
Chinese characters can be identified using regular expressions that match Unicode ranges specific to Chinece script.
public static boolean containsChinese(String input) {
java.util.regex.Pattern pa ...
Posted on Tue, 12 May 2026 16:06:49 +0000 by MichaelR