Back to Type Challenges

README.Zh CN

questions/00110-medium-capitalize/README.zh-CN.md

latest1.7 KB
Original Source
<!--info-header-start--><h1>Capitalize </h1><blockquote><p>by Anthony Fu <a href="https://github.com/antfu" target="_blank">@antfu</a></p></blockquote><p><a href="https://tsch.js.org/110/play/zh-CN" target="_blank"></a> &nbsp;&nbsp;&nbsp;<a href="./README.md" target="_blank"></a> <a href="./README.ja.md" target="_blank"></a> <a href="./README.ko.md" target="_blank"></a> </p><!--info-header-end-->

实现 Capitalize<T> 它将字符串的第一个字母转换为大写,其余字母保持原样。

例如

ts
type capitalized = Capitalize<'hello world'> // expected to be 'Hello world'
<!--info-footer-start-->

<a href="../../README.zh-CN.md" target="_blank"></a> <a href="https://tsch.js.org/110/answer/zh-CN" target="_blank"></a> <a href="https://tsch.js.org/110/solutions" target="_blank"></a> <!--info-footer-end-->