T-string(常见于编程语境)指一种“带标记/可处理的字符串字面量”,通常让你把字符串内容与“插值表达式”结构化地交给某个处理器(tag/function)进一步解析、格式化、转义或做安全处理。常被理解为类似 f-string 的扩展思路,但更强调“把字符串交给处理函数处理”。(不同语言/提案中细节可能不同。)
/ˈtiː strɪŋ/
I used a t-string to build the message safely.
我用 t-string 来安全地构建这条消息。
In the new design, t-strings allow a function to receive both the raw text and the embedded expressions, making it easier to escape user input and prevent injection bugs.
在新的设计里,t-string 让函数同时接收原始文本和嵌入的表达式,从而更容易对用户输入做转义并避免注入类漏洞。
由字母 T + string 组成:string 表示“字符串”,而 T 多被解释为 template(模板) 或 tagged(带标签/带标记) 的缩写,强调“字符串不仅是文本,还携带可供处理的结构信息”。