feat(stdlib): Mid M4 csv and thickened text helpers
Add lib/csv parse/stringify and expand lib/text with contains, replace, case, pad, and related golds plus public demos. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
1 parent
08384c7540
commit
506de65dae
22 files changed
+766
-15
No files matched your search
+55
-1
@@ -1,6 +1,6 @@
|
||||
---
|
||||
title: lib/text
|
||||
description: English text helpers over trim / split / join
|
||||
description: Text helpers (Mid M4 thicken). Literal replace — use lib/re for regex.
|
||||
---
|
||||
|
||||
## str_trim
|
||||
@@ -19,3 +19,57 @@ description: English text helpers over trim / split / join
|
||||
+ `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`**
|
||||
Reference in new issue
Block a user