Files
.github
api-server
client
config
curriculum
__fixtures__
challenges
_meta
arabic
chinese
01-responsive-web-design
02-javascript-algorithms-and-data-structures
basic-algorithm-scripting
boo-who.md
chunky-monkey.md
confirm-the-ending.md
convert-celsius-to-fahrenheit.md
factorialize-a-number.md
falsy-bouncer.md
find-the-longest-word-in-a-string.md
finders-keepers.md
mutations.md
repeat-a-string-repeat-a-string.md
return-largest-numbers-in-arrays.md
reverse-a-string.md
slice-and-splice.md
title-case-a-sentence.md
truncate-a-string.md
where-do-i-belong.md
basic-data-structures
basic-javascript
debugging
es6
functional-programming
intermediate-algorithm-scripting
javascript-algorithms-and-data-structures-projects
object-oriented-programming
regular-expressions
03-front-end-libraries
04-data-visualization
05-apis-and-microservices
06-quality-assurance
07-scientific-computing-with-python
08-data-analysis-with-python
09-information-security
10-coding-interview-prep
11-machine-learning-with-python
12-certificates
english
portuguese
russian
spanish
schema
test
.babelrc
LICENSE.md
comment-dictionary.js
create-challenge-bundle.js
getChallenges.acceptance.test.js
getChallenges.js
getChallenges.test.js
gulpfile.js
lib.js
package-entry.js
package-lock.json
package.json
utils.js
cypress
docs
tools
utils
.editorconfig
.eslintignore
.eslintrc.json
.gitattributes
.gitignore
.gitpod.yml
.node-inspectorrc
.npmrc
.prettierignore
.prettierrc
.snyk
.vcmrc
CODE_OF_CONDUCT.md
CONTRIBUTING.md
Dockerfile.tests
HoF.md
LICENSE.md
README.md
SECURITY.md
change_volumes_owner.sh
crowdin.yml
cypress-install.js
cypress.json
docker-compose-shared.yml
docker-compose.tests.yml
docker-compose.yml
jest.config.js
lerna.json
lighthouserc.js
package-lock.json
package.json
sample.env

62 lines
1.8 KiB
Markdown
Raw Normal View History

---
id: ab6137d4e35944e21037b769
title: Title Case a Sentence
challengeType: 5
videoUrl: ''
localeTitle: 标题案例句子
---
## Description
2020-06-30 01:51:26 -07:00
<section id="description">返回提供的字符串每个单词的首字母大写。确保单词的其余部分为小写。出于本练习的目的您还应该将诸如“the”和“of”之类的连接词大写。如果卡住请记得使用<a href="https://forum.freecodecamp.org/t/how-to-get-help-when-you-are-stuck-coding/19514" target="_blank">Read-Search-Ask</a> 。编写自己的代码。 </section>
## Instructions
<section id="instructions">
</section>
## Tests
<section id='tests'>
```yml
tests:
- text: '<code>titleCase(&quot;I&#39;m a little tea pot&quot;)</code>应该返回一个字符串。'
testString: assert(typeof titleCase("I'm a little tea pot") === "string");
- text: '<code>titleCase(&quot;I&#39;m a little tea pot&quot;)</code>应该归还<code>I&#39;m A Little Tea Pot</code> 。'
testString: assert(titleCase("I'm a little tea pot") === "I'm A Little Tea Pot");
- text: <code>titleCase(&quot;sHoRt AnD sToUt&quot;)</code>应返回<code>Short And Stout</code>
testString: assert(titleCase("sHoRt AnD sToUt") === "Short And Stout");
- text: <code>titleCase(&quot;HERE IS MY HANDLE HERE IS MY SPOUT&quot;)</code> <code>Here Is My Handle Here Is My Spout</code> <code>titleCase(&quot;HERE IS MY HANDLE HERE IS MY SPOUT&quot;)</code>应该回到<code>Here Is My Handle Here Is My Spout</code>
testString: assert(titleCase("HERE IS MY HANDLE HERE IS MY SPOUT") === "Here Is My Handle Here Is My Spout");
```
</section>
## Challenge Seed
<section id='challengeSeed'>
<div id='js-seed'>
```js
function titleCase(str) {
return str;
}
titleCase("I'm a little tea pot");
```
</div>
</section>
## Solution
<section id='solution'>
```js
// solution required
```
/section>