StringTrim

StringTrim["string"]

删除 "string" 的前端和末端的空白区域.

StringTrim["string",patt]

从前端和末端,删除匹配 patt 的子串.

更多信息和选项

  • 空白区域可以包括任意数量的空格、制表符和换行符.
  • StringTrim[{s1,s2,},] 对于每个 si 给出结果列表.

范例

基本范例  (3)

从字符串末端开始删除空白区域:

删除多个字符类型:

用一个规则表达式模式,删除前端的空格字符:

Wolfram Research (2008),StringTrim,Wolfram 语言函数,https://reference.wolfram.com/language/ref/StringTrim.html.

文本

Wolfram Research (2008),StringTrim,Wolfram 语言函数,https://reference.wolfram.com/language/ref/StringTrim.html.

CMS

Wolfram 语言. 2008. "StringTrim." Wolfram 语言与系统参考资料中心. Wolfram Research. https://reference.wolfram.com/language/ref/StringTrim.html.

APA

Wolfram 语言. (2008). StringTrim. Wolfram 语言与系统参考资料中心. 追溯自 https://reference.wolfram.com/language/ref/StringTrim.html 年

BibTeX

@misc{reference.wolfram_2024_stringtrim, author="Wolfram Research", title="{StringTrim}", year="2008", howpublished="\url{https://reference.wolfram.com/language/ref/StringTrim.html}", note=[Accessed: 22-November-2024 ]}

BibLaTeX

@online{reference.wolfram_2024_stringtrim, organization={Wolfram Research}, title={StringTrim}, year={2008}, url={https://reference.wolfram.com/language/ref/StringTrim.html}, note=[Accessed: 22-November-2024 ]}