# Changing a normal string to camelCase

**URL:** <https://discourse.processing.org/t/changing-a-normal-string-to-camelcase/33744>\
**Category:** Coding Questions\
**Created:** [November 25, 2021, 7:07am UTC](https://discourse.processing.org/t/changing-a-normal-string-to-camelcase/33744 "2021-11-25T07:07:05Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![it\_begins](https://avatars.discourse-cdn.com/v4/letter/i/bc8723/32.png) [@it\_begins](https://discourse.processing.org/u/it_begins)\
**Post date:** [November 25, 2021, 7:07am UTC](https://discourse.processing.org/t/changing-a-normal-string-to-camelcase/33744/1 "2021-11-25T07:07:05Z")

</div>

Hi,  
i have to change a set of string to calmelcase i.e removing punctuations and spaces,and capitalizing the first letter of each word… Using only these string functions:  
charAt(), length(), toUpperCase(), toLowerCase(). The only Character class functions are: e: isAlphabetic(), isLetter(), isSpaceChar(), isUpperCase(), isLowerCase(), toUpperCase(), toLowerCase().  
Help needed urgently, thank you in advance.

---

<div class="post-metadata">

**Author:** ![quark](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/quark/32/26_2.png) [@quark](https://discourse.processing.org/u/quark)\
**Post date:** [November 25, 2021, 8:42am UTC](https://discourse.processing.org/t/changing-a-normal-string-to-camelcase/33744/2 "2021-11-25T08:42:30Z")

</div>

This sounds like homework so you should have a try yourself and when you get stuck post your effort and ask for advice. We do not provide full code solutions 🙂

---

<div class="post-metadata">

**Author:** ![glv](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/glv/32/18785_2.png) [@glv](https://discourse.processing.org/u/glv)\
**Post date:** [November 25, 2021, 12:16pm UTC](https://discourse.processing.org/t/changing-a-normal-string-to-camelcase/33744/3 "2021-11-25T12:16:04Z")

</div>

Hello,

_[FAQ - Processing Foundation](https://discourse.processing.org/faq#keep-tidy)_ asks that you:

`* Don’t cross-post the same thing in multiple topics.`

The cross-post (related content and urgency) is in the topic here:

> [@Turning a set of string to constant case](https://discourse.processing.org/t/turning-a-set-of-string-to-constant-case/33745):
>
> Help needed urgently. I have a question that needs to change a set of strings to constant case. That is replacing spaces with underscores, removing punctuations, and capitalizing all letters. using only these string functions: are: charAt(), length(), toUpperCase(), toLowerCase(). The only Character class functions allowed are: isAlphabetic(), isLetter(), isSpaceChar(), isUpperCase(), isLowerCase(), toUpperCase(), toLowerCase(). Thank you…

`:)`

---

<div class="post-metadata">

**Author:** ![TfGuy44](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/tfguy44/32/41_2.png) [@TfGuy44](https://discourse.processing.org/u/TfGuy44)\
**Post date:** [November 25, 2021, 12:20pm UTC](https://discourse.processing.org/t/changing-a-normal-string-to-camelcase/33744/4 "2021-11-25T12:20:38Z")

</div>

Imagine you are the function tasked to do the conversion.

How would you do it?

One approach might be to look at each letter in the string, in order.

You might use a loop to do this.

You can use charAt() to look at each letter.

What do you need to check for each character?

You might need to know if it is a letter.

You might be interested in remembering if it is a space.

When should you capitalize a letter?

How will you record the output?

You might consider having a second empty string that you add letters to.

Do you need to add the spaces?
