注意
https://wiki.hktrpg.com/
新維基站開放中
歡迎測試使用
檢視 模板:Str len/core 的原始碼
←
模板:Str len/core
跳至導覽
跳至搜尋
由於下列原因,您沒有權限進行編輯此頁面的動作:
您請求的操作只有這個群組的使用者能使用:
使用者
您可以檢視並複製此頁面的原始碼。
{{<noinclude><!--Syntax highlighter補丁--></noinclude>{{{|safesubst:}}}#switch: {{{3|}}} | hundreds = <noinclude><!-- 0xx-4xx, using linear search since most strings will probably be less than 100 bytes. --></noinclude> {{<noinclude><!--Syntax highlighter補丁--></noinclude>{{{|safesubst:}}}#ifeq: x{{{1|}}} | x{{<noinclude><!--Syntax highlighter補丁--></noinclude>{{{|safesubst:}}}padleft:{{{1|}}}| 100 }} <noinclude><!--str >= x--></noinclude> | {{<noinclude><!--Syntax highlighter補丁--></noinclude>{{{|safesubst:}}}#ifeq: x{{{1|}}} | x{{<noinclude><!--Syntax highlighter補丁--></noinclude>{{{|safesubst:}}}padleft:{{{1|}}}| 200 }} | {{<noinclude><!--Syntax highlighter補丁--></noinclude>{{{|safesubst:}}}#ifeq: x{{{1|}}} | x{{<noinclude><!--Syntax highlighter補丁--></noinclude>{{{|safesubst:}}}padleft:{{{1|}}}| 300 }} | {{<noinclude><!--Syntax highlighter補丁--></noinclude>{{{|safesubst:}}}#ifeq: x{{{1|}}} | x{{<noinclude><!--Syntax highlighter補丁--></noinclude>{{{|safesubst:}}}padleft:{{{1|}}}| 400 }} | 4 | 3 }} | 2 }} | 1 }} | <noinclude><!-- Don't return 0, since tens and ones don't want a leading 0 in parameter 2. --></noinclude> }} | tens = <noinclude><!-- x0x-x9x, using linear search for 0x-3x, binary search for 4x-9x, since most strings will probably be 0-39 bytes. --></noinclude> {{{2|}}}{{ {{{|safesubst:}}}#ifeq: x{{{1|}}} | x{{<noinclude><!--Syntax highlighter補丁--></noinclude>{{{|safesubst:}}}padleft:{{{1|}}}| {{{2|}}}10 }} <noinclude><!--str >= x--></noinclude> | {{<noinclude><!--Syntax highlighter補丁--></noinclude>{{{|safesubst:}}}#ifeq: x{{{1|}}} | x{{<noinclude><!--Syntax highlighter補丁--></noinclude>{{{|safesubst:}}}padleft:{{{1|}}}| {{{2|}}}20 }} | {{<noinclude><!--Syntax highlighter補丁--></noinclude>{{{|safesubst:}}}#ifeq: x{{{1|}}} | x{{<noinclude><!--Syntax highlighter補丁--></noinclude>{{{|safesubst:}}}padleft:{{{1|}}}| {{{2|}}}30 }} | {{<noinclude><!--Syntax highlighter補丁--></noinclude>{{{|safesubst:}}}#ifeq: x{{{1|}}} | x{{<noinclude><!--Syntax highlighter補丁--></noinclude>{{{|safesubst:}}}padleft:{{{1|}}}| {{{2|}}}40 }} | {{<noinclude><!--Syntax highlighter補丁--></noinclude>{{{|safesubst:}}}#ifeq: x{{{1|}}} | x{{<noinclude><!--Syntax highlighter補丁--></noinclude>{{{|safesubst:}}}padleft:{{{1|}}}| {{{2|}}}60 }} | {{<noinclude><!--Syntax highlighter補丁--></noinclude>{{{|safesubst:}}}#ifeq: x{{{1|}}} | x{{<noinclude><!--Syntax highlighter補丁--></noinclude>{{{|safesubst:}}}padleft:{{{1|}}}| {{{2|}}}80 }} | {{<noinclude><!--Syntax highlighter補丁--></noinclude>{{{|safesubst:}}}#ifeq: x{{{1|}}} | x{{<noinclude><!--Syntax highlighter補丁--></noinclude>{{{|safesubst:}}}padleft:{{{1|}}}| {{{2|}}}90 }} | 9 | 8 }} | {{<noinclude><!--Syntax highlighter補丁--></noinclude>{{{|safesubst:}}}#ifeq: x{{{1|}}} | x{{<noinclude><!--Syntax highlighter補丁--></noinclude>{{{|safesubst:}}}padleft:{{{1|}}}| {{{2|}}}70 }} | 7 | 6 }} }} | {{<noinclude><!--Syntax highlighter補丁--></noinclude>{{{|safesubst:}}}#ifeq: x{{{1|}}} | x{{<noinclude><!--Syntax highlighter補丁--></noinclude>{{{|safesubst:}}}padleft:{{{1|}}}| {{{2|}}}50 }} | 5 | 4 }} }} | 3 }} | 2 }} | 1 }} | {{<noinclude><!--Syntax highlighter補丁--></noinclude>{{{|safesubst:}}}#if:{{{2|}}}|0}} <noinclude><!-- Only return 0 if >=100, since ones don't want a leading 0 in parameter 2. --></noinclude> }} | ones = <noinclude><!-- xx0-xx9, using binary search. --></noinclude> {{{2|}}}{{ {{{|safesubst:}}}#ifeq: x{{{1|}}} | x{{<noinclude><!--Syntax highlighter補丁--></noinclude>{{{|safesubst:}}}padleft:{{{1|}}}| {{{2|}}}4 }} <noinclude><!--str >= x--></noinclude> | {{<noinclude><!--Syntax highlighter補丁--></noinclude>{{{|safesubst:}}}#ifeq: x{{{1|}}} | x{{<noinclude><!--Syntax highlighter補丁--></noinclude>{{{|safesubst:}}}padleft:{{{1|}}}| {{{2|}}}6 }} | {{<noinclude><!--Syntax highlighter補丁--></noinclude>{{{|safesubst:}}}#ifeq: x{{{1|}}} | x{{<noinclude><!--Syntax highlighter補丁--></noinclude>{{{|safesubst:}}}padleft:{{{1|}}}| {{{2|}}}8 }} | {{<noinclude><!--Syntax highlighter補丁--></noinclude>{{{|safesubst:}}}#ifeq: x{{{1|}}} | x{{<noinclude><!--Syntax highlighter補丁--></noinclude>{{{|safesubst:}}}padleft:{{{1|}}}| {{{2|}}}9 }} | 9 | 8 }} | {{<noinclude><!--Syntax highlighter補丁--></noinclude>{{{|safesubst:}}}#ifeq: x{{{1|}}} | x{{<noinclude><!--Syntax highlighter補丁--></noinclude>{{{|safesubst:}}}padleft:{{{1|}}}| {{{2|}}}7 }} | 7 | 6 }} }} | {{<noinclude><!--Syntax highlighter補丁--></noinclude>{{{|safesubst:}}}#ifeq: x{{{1|}}} | x{{<noinclude><!--Syntax highlighter補丁--></noinclude>{{{|safesubst:}}}padleft:{{{1|}}}| {{{2|}}}5 }} | 5 | 4 }} }} | {{<noinclude><!--Syntax highlighter補丁--></noinclude>{{{|safesubst:}}}#ifeq: x{{{1|}}} | x{{<noinclude><!--Syntax highlighter補丁--></noinclude>{{{|safesubst:}}}padleft:{{{1|}}}| {{{2|}}}2 }} | {{<noinclude><!--Syntax highlighter補丁--></noinclude>{{{|safesubst:}}}#ifeq: x{{{1|}}} | x{{<noinclude><!--Syntax highlighter補丁--></noinclude>{{{|safesubst:}}}padleft:{{{1|}}}| {{{2|}}}3 }} | 3 | 2 }} | {{<noinclude><!--Syntax highlighter補丁--></noinclude>{{{|safesubst:}}}#ifeq: x{{{1|}}} | x{{<noinclude><!--Syntax highlighter補丁--></noinclude>{{{|safesubst:}}}padleft:{{{1|}}}| {{{2|}}}1 }} | 1 | 0 }} }} }} }}<noinclude>{{Documentation|content={{引自其他wiki|中文維基|Template:Str_len/core}} <!--普通用戶不太要看懂的吧 看得懂的人不要說明的吧。。--> [[Category:辅助模板]]}}</noinclude>
返回到「
模板:Str len/core
」。
導覽選單
個人工具
建立帳號
登入
命名空間
模板
討論
繁體
已展開
已摺疊
視圖
閱讀
檢視原始碼
檢視歷史
更多
已展開
已摺疊
搜尋
導覽
首頁
近期變更
隨機頁面
MediaWiki說明
工具
連結至此的頁面
相關變更
特殊頁面
頁面資訊