长度(字符串)

来自GSXAB的知识库
长度
术语名称 长度
英语名称 length

长度(length)指把一个字符串中字符的数量。

定义

长度
运算名称 长度
运算符号 [math]\displaystyle{ |\bullet| }[/math]
Latex
\vert\vert
运算对象 字符串
运算元数 1
运算结果 自然数
定义域 [math]\displaystyle{ \Sigma^* }[/math]
陪域 [math]\displaystyle{ \mathbb{N} }[/math]

字符串 [math]\displaystyle{ a = \mathtt{a}_1 \mathtt{a}_2 \cdots \mathtt{a}_n }[/math] ,称 [math]\displaystyle{ n }[/math] 为字符串的长度(length),记作 [math]\displaystyle{ |a| }[/math]


字符串
特殊字符串 空字符串 [math]\displaystyle{ \varepsilon }[/math]
运算 长度 [math]\displaystyle{ |\bullet| }[/math]
连接 [math]\displaystyle{ \bullet \bullet }[/math]
自连接 [math]\displaystyle{ \bullet^n }[/math] Kleene 闭包 [math]\displaystyle{ \bullet^* }[/math] 、 Kleene+ 闭包 [math]\displaystyle{ \bullet^+ }[/math]
反转 [math]\displaystyle{ \bullet^\mathrm{R} }[/math]
关系 子串 子列
前缀、后缀 公共前后缀