Back to Type Challenges

README.Ja

questions/00651-hard-length-of-string-2/README.ja.md

latest2.0 KB
Original Source
<!--info-header-start--><h1>Length of String 2 </h1><blockquote><p>by null <a href="https://github.com/uid11" target="_blank">@uid11</a></p></blockquote><p><a href="https://tsch.js.org/651/play/ja" target="_blank"></a> &nbsp;&nbsp;&nbsp;<a href="./README.md" target="_blank"></a> </p><!--info-header-end-->

テンプレート文字列の長さを計算するLengthOfString<S>を実装します。(298 - Length of Stringと同じような型):

ts
type T0 = LengthOfString<'foo'>; // 3

この課題で実装する型は、数百文字の長さの文字列をサポートしなければなりません(通常の再帰的な文字列長の計算は、TS の再帰的な関数呼び出しの深さによって制限されています、つまり、45 文字程度までの文字列をサポートしています)。

<!--info-footer-start-->

<a href="../../README.ja.md" target="_blank"></a> <a href="https://tsch.js.org/651/answer/ja" target="_blank"></a> <a href="https://tsch.js.org/651/solutions" target="_blank"></a> <hr><h3>関連する課題</h3><a href="https://github.com/type-challenges/type-challenges/blob/main/questions/00298-medium-length-of-string/README.ja.md" target="_blank"></a> <!--info-footer-end-->