Length of String
约 83 字小于 1 分钟
2026-02-11
题目
计算字符串的长度,类似于 String#length 。
解题思路
待补充
答案
type LengthOfString<S extends string> = any验证
import type { Equal, Expect } from '@type-challenges/utils'
type cases = [
Expect<Equal<LengthOfString<''>, 0>>,
Expect<Equal<LengthOfString<'kumiko'>, 6>>,
Expect<Equal<LengthOfString<'reina'>, 5>>,
Expect<Equal<LengthOfString<'Sound! Euphonium'>, 16>>,
]参考
无
