国产精品天干天干,亚洲毛片在线,日韩gay小鲜肉啪啪18禁,女同Gay自慰喷水

歡迎光臨散文網(wǎng) 會(huì)員登陸 & 注冊(cè)

Go 標(biāo)準(zhǔn)包 strings 學(xué)習(xí)(2) ContainsAny,ContainsRune,Count

2023-04-21 13:20 作者:取悅疾風(fēng)  | 我要投稿

func?ContainsAny

ContainsAny reports whether any Unicode code points in chars are within s.

翻譯

ContainsAny報(bào)告字符中的Unicode碼位是否在s內(nèi)。

舉例

結(jié)果

理解

前面字符串包含后面字符串里面的任意一個(gè)字符就返回true,空串返回false

func?ContainsRune

ContainsRune reports whether the Unicode code point r is within s.

翻譯

ContainsRune報(bào)告Unicode碼點(diǎn)r是否在s內(nèi)。

這里point是指針,不是點(diǎn)

舉例

結(jié)果

理解

返回字符串里面是否包含某個(gè)阿斯克碼(ASCII),這里的阿斯克碼使用數(shù)字表示

func?Count

Count counts the number of non-overlapping instances of substr in s. If substr is an empty string, Count returns 1 + the number of Unicode code points in s.

翻譯

Count計(jì)算s中substr的非重疊實(shí)例的個(gè)數(shù)。如果substr為空字符串,Count返回1 + s中Unicode碼點(diǎn)的個(gè)數(shù)。

舉例

結(jié)果

理解

返回第二個(gè)字符串在第一個(gè)字符串里面出現(xiàn)了幾次


Go 標(biāo)準(zhǔn)包 strings 學(xué)習(xí)(2) ContainsAny,ContainsRune,Count的評(píng)論 (共 條)

分享到微博請(qǐng)遵守國(guó)家法律
称多县| 佳木斯市| 石渠县| 武清区| 大悟县| 石林| 南开区| 太谷县| 巨鹿县| 沿河| 温宿县| 韩城市| 剑川县| 新邵县| 南郑县| 揭东县| 和顺县| 来宾市| 五原县| 乌鲁木齐县| 千阳县| 嘉禾县| 德江县| 曲阜市| 濮阳县| 三都| 浮山县| 榕江县| 芦溪县| 无极县| 芦山县| 新巴尔虎右旗| 靖西县| 册亨县| 双鸭山市| 孝感市| 三门县| 琼结县| 彰武县| 渝中区| 紫金县|