Bare identifiers inside *…* are variables; quote text args (and var="x") so marqdo run on public/*.mq.md succeeds. Narrow pages.yml exclude to utils.mq.md and 工具.mq.md instead of overly broad ??.mq.md. Co-authored-by: Cursor <cursoragent@cursor.com>
35 lines
480 B
Markdown
35 lines
480 B
Markdown
---
|
|
title: Built-ins len / str / int / type / trim / split / join / at
|
|
description: Host builtins for strings and tables
|
|
---
|
|
|
|
# main
|
|
|
|
Length and type:
|
|
|
|
*`s` = "hello"*
|
|
|
|
*`n` = > len `s`*
|
|
|
|
> print text=`n`
|
|
|
|
*`ty` = > type `s`*
|
|
|
|
> print text=`ty`
|
|
|
|
Trim, split, join, and index:
|
|
|
|
*`t` = > trim value=" hi "*
|
|
|
|
*`parts` = > split value="a,b" sep=","*
|
|
|
|
*`mid` = > at value=`parts` index=0*
|
|
|
|
*`j` = > join value=`parts` sep="-"*
|
|
|
|
> print text=`t`
|
|
|
|
> print text=`mid`
|
|
|
|
> print text=`j`
|