shell获取字符串长度

获取字符串长度可能是编程中最常用的操作了.

shell:

txt="abcd"
n=${#txt}

javascript:

var txt = "Hello world!";
var n = txt.length;

python
txt='python'
len(text)

显然,越晚的语言可读性越好。
未来,编程就会像写文章一样。

posted @ 2020-08-04 10:39  福尔  阅读(253)  评论(0编辑  收藏  举报