Tagged articles
Substring
10 articles · Page 1 of 1
This article explains Java's immutable String class, covering three ways to instantiate strings, methods for length, concatenation (concat and +), character access, substring extraction, splitting, replacing, searching, and comparison using equals versus ==, with concrete code examples and key rules for each operation.
ImmutableJavaString
0 likes · 12 min read

This article explains the LeetCode 1297 problem of finding the substring that appears most often while respecting limits on distinct characters and length, and provides a detailed sliding‑window analysis together with complete Java and C++ reference implementations.
C++JavaSubstring
0 likes · 6 min read

This article explains the three JavaScript string extraction methods—substr(), substring() and slice()—highlighting why slice() is now preferred, detailing deprecation reasons for substr(), comparing behavior, parameter handling, and consistency, and summarizing its advantages over the other methods.
JavaScriptString MethodsSubstring
0 likes · 4 min read

This article demonstrates five Bash methods—using grep, the =~ operator, wildcards, case statements, and parameter substitution—to determine whether one string contains another, and also shows two ways to check if a file includes a specific text.
StringSubstringbash
0 likes · 4 min read

The article explains PHP’s mb_strstr() function, detailing its syntax, how it finds the first occurrence of a needle in a haystack, the optional before_needle and encoding parameters, and the return values including FALSE when the needle is absent.
BackendPHPSubstring
0 likes · 2 min read

The article explains PHP's mb_substr_count function, detailing its syntax, parameters, return value, and provides a practical example showing how to count the number of times a substring appears within a multibyte string.
BackendStringSubstring
0 likes · 2 min read

The article explains PHP's mb_substr() function for multibyte-safe substring extraction, detailing its parameters, usage, and return value, and provides two practical code examples demonstrating how to extract Chinese characters with specified length and encoding.
StringSubstringencoding
0 likes · 2 min read

This article explains PHP’s mb_substr() function, detailing its multibyte‑safe substring behavior, parameter definitions, return value, and provides a practical code example illustrating how to extract a portion of a Chinese string correctly.
PHPStringSubstring
0 likes · 2 min read

This guide explains how to correctly truncate strings containing Chinese characters in PHP by detecting character byte length for GBK and UTF‑8 encodings, and provides a reusable my_substr function with example usage.
BackendChinese charactersGBK
0 likes · 4 min read

This article explains how the original JDK 6 implementation of String.substring could retain large character arrays and cause apparent memory‑leak‑like OutOfMemoryError, describes the underlying fields, reproduces the issue, and shows how JDK 7’s copy‑on‑substring redesign resolves the problem.
JDK6JDK7Java
0 likes · 10 min read
