Files
marqdo/lib/text.mq.md
T
cflmyandCursor bfb10d172b feat(markup): adopt v0.3 as sole mapping (** code, * return)
Make prose-unified Markup the only runtime: bold segments are executable,
italic is return, params can be inferred from body/prose, with no v0.2 dual
mode. Migrate lib and structure/keywords golds; gate on tests/markup-v03.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-13 20:38:53 +08:00

76 lines
1.1 KiB
Markdown

---
title: lib/text
description: Text helpers (Mid M4 thicken). Literal replace — use lib/re for regex.
---
## str_trim
+ `s`
*> trim `s`*
## str_split
+ `s`
+ `sep`
*> split value=`s` sep=`sep`*
## str_join
+ `xs`
+ `sep`
*> join value=`xs` sep=`sep`*
## contains
+ `text`
+ `sub`
*> host_text_contains text=`text` sub=`sub`*
## starts_with
+ `text`
+ `prefix`
*> host_text_starts_with text=`text` prefix=`prefix`*
## ends_with
+ `text`
+ `suffix`
*> host_text_ends_with text=`text` suffix=`suffix`*
## replace
+ `text`
+ `old`
+ `new`
+ `count`=None
Literal substring replace (`count` optional).
*> host_text_replace text=`text` old=`old` new=`new` count=`count`*
## to_upper
+ `text`
*> host_text_to_upper text=`text`*
## to_lower
+ `text`
*> host_text_to_lower text=`text`*
## repeat
+ `text`
+ `n`
*> host_text_repeat text=`text` n=`n`*
## pad
+ `text`
+ `width`
+ `fill`=None
+ `align`=None
align: left (default), right, or center.
*> host_text_pad text=`text` width=`width` fill=`fill` align=`align`*