string length
常見例句
- string-length("Brett") obviously returns 5, and normalize-space(" Brett McLaughlin ") returns "Brett McLaughlin".
string-length("Brett") 顯然返回 5,normalize-space(" Brett McLaughlin ") 則返回 "Brett McLaughlin"。 - One improvement might be to generate a blind table for short paragraphs only (you can evaluate the length of a paragraph with the string-length() function).
改進(jìn)方法之一可能是只對短的段生成隱形表(可以用 string-length() 函數(shù)計(jì)算段的長度)。 - Rules for unnamed nodes are allowed but not often used (for example, *[string-length(.) > 10], which matches any element with more than 10 characters of text content).
允許使用未命名節(jié)點(diǎn)的規(guī)則,但這些規(guī)則并不常用(例如, *[string-length(.) > 10] ,它匹配任何文本內(nèi)容多于 10 個(gè)字符的元素)。 - - And because I'm writing out a string that's the same length -- -- my strings aren't getting shorter -- it's creating this illusion of some animation.
因?yàn)槲覍懥艘粋€(gè)長度相同的字符串-,我的字符串不會(huì)變的更短-,它生成一個(gè)動(dòng)畫幻覺。
哈佛公開課 - 計(jì)算機(jī)科學(xué)課程節(jié)選 - I certainly don't want to assume they're always going to type a three-letter or a four-letter or a two-letter word I want some dynamism but that's fine because get string can get a string of any length, I can then use the string length function to just ask while the program is running how big is the string that I was handed?
當(dāng)然我不能假設(shè)他總是,輸入3個(gè)字符或4個(gè)字符,或2個(gè)字符的單詞,我想要?jiǎng)討B(tài)地分配,因?yàn)镚etString可以獲得任意長度的字符串,然后我可以使用strlen函數(shù),來得到那個(gè)我傳遞的字符串,有多長?
哈佛公開課 - 計(jì)算機(jī)科學(xué)課程節(jié)選 返回 string length