# Title Case a Sentence SOLVED

**URL:** <https://forum.freecodecamp.org/t/title-case-a-sentence-solved/188968>\
**Category:** Curriculum Help\
**Tags:** javascript\
**Created:** [May 2, 2018, 4:06pm UTC](https://forum.freecodecamp.org/t/title-case-a-sentence-solved/188968 "2018-05-02T16:06:46Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![rinran](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/rinran/32/160218_2.png) [@rinran](https://forum.freecodecamp.org/u/rinran)\
**Post date:** [May 2, 2018, 4:06pm UTC](https://forum.freecodecamp.org/t/title-case-a-sentence-solved/188968/1 "2018-05-02T16:06:47Z")

</div>

**Tell us what’s happening:**  
I’m not sure what to do next. I can get the first character of each word uppercase, but now I don’t know how to join the string back together with the uppercase letter. I’ll continue working and update if I get it.

**Your code so far**

```auto
function titleCase(str) {
  var a;
  a = str.toLowerCase().split(' '); //makes the string lowercase and splits it up
  for (i=0; i<a.length; i++) { //goes through each word
    a[i] = a[i].charAt(0).toUpperCase() + a[i].slice(1);
  }
  return a.join(" ");
}

titleCase("I'm a little tea pot");

```

**Your browser information:**

Your Browser User Agent is: `Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/65.0.3325.181 Safari/537.36`.

**Link to the challenge:**  
[https://www.freecodecamp.org/challenges/title-case-a-sentence](https://www.freecodecamp.org/challenges/title-case-a-sentence)

---

<div class="post-metadata">

**Author:** ![ArielLeslie](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/arielleslie/32/264841_2.png) [@ArielLeslie](https://forum.freecodecamp.org/u/ArielLeslie)\
**Post date:** [May 2, 2018, 4:15pm UTC](https://forum.freecodecamp.org/t/title-case-a-sentence-solved/188968/2 "2018-05-02T16:15:09Z")

</div>

I suggest reviewing [Concatenating Strings with the Plus Operator](https://www.freecodecamp.org/challenges/concatenating-strings-with-plus-operator)

---

<div class="post-metadata">

**Author:** ![rinran](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/rinran/32/160218_2.png) [@rinran](https://forum.freecodecamp.org/u/rinran)\
**Post date:** [May 2, 2018, 5:17pm UTC](https://forum.freecodecamp.org/t/title-case-a-sentence-solved/188968/3 "2018-05-02T17:17:05Z")

</div>

Updated question, any suggestions?

---

<div class="post-metadata">

**Author:** ![ArielLeslie](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/arielleslie/32/264841_2.png) [@ArielLeslie](https://forum.freecodecamp.org/u/ArielLeslie)\
**Post date:** [May 2, 2018, 5:19pm UTC](https://forum.freecodecamp.org/t/title-case-a-sentence-solved/188968/4 "2018-05-02T17:19:28Z")

</div>

If you’re trying to get your words from an array into a string, look into the `join()` function.

---

<div class="post-metadata">

**Author:** ![rinran](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/rinran/32/160218_2.png) [@rinran](https://forum.freecodecamp.org/u/rinran)\
**Post date:** [May 2, 2018, 5:49pm UTC](https://forum.freecodecamp.org/t/title-case-a-sentence-solved/188968/5 "2018-05-02T17:49:16Z")

</div>

A buddy helped me get this one figured out, thanks for the help.

---

<div class="post-metadata">

**Author:** ![ILM](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/ilm/32/363239_2.png) [@ILM](https://forum.freecodecamp.org/u/ILM)\
**Post date:** [February 2, 2021, 11:53am UTC](https://forum.freecodecamp.org/t/title-case-a-sentence-solved/188968/6 "2021-02-02T11:53:25Z")

</div>

Closed on February 2, 2021, 11:53am UTC


