字符索引字符串处理工具

version : 1.0.0

find_nth_char

Find index of nth occurrence of a character. Returns -1 if not found.

*text(string)

*char(string)

n(integer)

结果(Result)

find_all_char_indices

Find all indices where a character appears. Returns empty list if not found.

*text(string)

*char(string)

结果(Result)

find_nth_substring

Find starting index of nth occurrence of a substring. Returns -1 if not found.

*text(string)

*substring(string)

n(integer)

结果(Result)

find_all_substring_indices

Find all starting indices where a substring appears (includes overlaps).

*text(string)

*substring(string)

结果(Result)

split_at_indices

Split text at exact index positions. Indices auto-sorted and deduplicated.

*text(string)

*indices(array)

结果(Result)

insert_at_index

Insert text at index position without replacing. Supports negative indices.

*text(string)

*index(integer)

*insertion(string)

结果(Result)

delete_range

Delete characters in range [start, end).

*text(string)

*start(integer)

*end(integer)

结果(Result)

replace_range

Replace characters in range [start, end) with new text.

*text(string)

*start(integer)

*end(integer)

*replacement(string)

结果(Result)

find_regex_matches

Find all regex matches with positions. Returns list of {start, end, match} dicts.

*text(string)

*pattern(string)

结果(Result)

extract_between_markers

Extract content between markers with positions. Returns dict with content and position info.

*text(string)

*start_marker(string)

*end_marker(string)

occurrence(integer)

结果(Result)

count_chars

Count character statistics. Returns dict with total, without_spaces, letters, digits, spaces, special.

*text(string)

结果(Result)

extract_substrings

Extract substrings by index ranges. Supports negative indices and omitting end. Returns list of {start, end, substring, length} dicts.

*text(string)

*ranges(array)

结果(Result)