# How to sort words alphabetically from a String?

**URL:** <https://discourse.processing.org/t/how-to-sort-words-alphabetically-from-a-string/12767>\
**Category:** Coding Questions\
**Created:** [July 17, 2019, 9:47pm UTC](https://discourse.processing.org/t/how-to-sort-words-alphabetically-from-a-string/12767 "2019-07-17T21:47:38Z")\
**Posts on this page:** 1\
**Showing post:** 71

<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:** [April 21, 2020, 4:46pm UTC](https://discourse.processing.org/t/how-to-sort-words-alphabetically-from-a-string/12767/71 "2020-04-21T16:46:39Z")

</div>

> [@lolonulu](#):
>
> I tried your solution in a sketch

Hello,

I was just sharing… you inspired me to try this.  
There are many ways to do things and I just threw this together quickly.

Give consideration to text alignment.  
I used in my example:  
`textAlign(CENTER, CENTER);`

This may not be directly related but shows how text alignment can be a consideration:

> [@Unexpected Character Movement](https://discourse.processing.org/t/unexpected-character-movement/16716/2):
>
> I dont see the Needle() function. Are you using translate() or rotate() inside it?

Stay well!

`:)`

---

_[View the full topic](https://discourse.processing.org/t/how-to-sort-words-alphabetically-from-a-string/12767)._
