Core Mechanics of Java String Objects and Manipulation Techniques
The java.lang.String class encapsulates sequences of characters within a Java application. Every text literal enclosed in double quotes constitutes an instance of this immutable class. Being located in the java.lang package, explicit import statements are unnecessary.
Immutability Characteristics
Instances of String maintain a fixed state once ...
Posted on Sat, 09 May 2026 14:06:43 +0000 by sfarid
Understanding the String.split Method in Java
The split method in Java is commonly used to divide strings based on a delimiter. The single-parameter version:
public String[] split(String regex) {
return split(regex, 0);
}
invokes an overloaded method with a default limit of 0. The underlying implementation:
public String[] split(String regex, int limit) {
String[] fast = Pattern.f ...
Posted on Sat, 09 May 2026 00:42:34 +0000 by ketola
Building a Custom String Class in C++
A custom string class typically wraps a dynamically alocated character array along with size and capacity tracking. The following implementation lives inside a dedicated namespace to avoid collisions with the standard library.
namespace custom
{
class string
{
private:
char* _data;
size_t _len;
size_t _cap;
...
Posted on Fri, 08 May 2026 01:30:05 +0000 by BRUUUCE