[Accounts] remove consecutive whitespace from user names

John  Smith is a valid username.

Do you see the problem with it?

You will never find it in the people list if you assume the 2 spaces in the name should just be 1 space.

Canvas don't consider this to ba a bug and insist that a community idea be created to deal with it.

My idea is that when usernames are created consecutive whitespace in the name be removed.

I should make it clear that I'm talking about consecutive white space created inadvertently.

Maybe through a copy and paste mishap from excel or word.

I can not imagine a use case where consecutive invisible characters is required.

Happy to be corrected on that one.


In one line of python

name_with_no_consecutive_whitespace = " ".join(re.split(r"\s+", name_field_string))

Someone probably knows how to write that in Ruby or Javascript!


Added to Theme

Add or improve search functionality Theme Status: Identified

Instructure Alumni
Instructure Alumni
Status changed to: Open


We've moved this forward for community discussion. Would you take a moment to amplify the use cases for having two spaces between a user's first and last name?

Community Participant

Having two whitespaces between names breaks name search. We use name search to determine if someone has an account yet, so it really needs to work intuitively. (And this happens to us all the time.)

I don't think this is an idea so much as it's a bug or known issue. Why would a name need two consecutive spaces anywhere?

Also you should remove leading/trailing whitespace. See my idea here.


name search.png

Community Team
Community Team
Status changed to: New
Community Team
Community Team
Status changed to: Added to Theme