strings.CountRunes

相較於 strings.RuneCount 函式,strings.CountRunes 排除了空白的情況下,計算字元數量。

{{ "Hello, 世界" | strings.CountRunes }} → 8