Thread: Converting a string containing Uppercase/Lowercase/whitespace/characters to lowercase

  1. #1
    Registered User
    Join Date
    Oct 2014
    Posts
    2

    Converting a string containing Uppercase/Lowercase/whitespace/characters to lowercase

    Hello, I have been looking around to find help on how to convert a string containing Uppercase/Lowercase/Whitespace/Special Characters to only Lowercase and removing the whitespace and characters.

    For example, a message like:

    "The: sky is (blue), the wAter is also blue'."

    Change that message to:

    "theskyisbluethewaterisalsoblue"

    Thanks in advance for the help!

  2. #2
    Registered User
    Join Date
    Jun 2005
    Posts
    6,815
    That is, reasonably obviously, a homework exercise - and this site has a homework policy here. You need to demonstrate a genuine attempt before expecting help. As yet, you have demonstrated no such attempt.
    Right 98% of the time, and don't care about the other 3%.

    If I seem grumpy or unhelpful in reply to you, or tell you you need to demonstrate more effort before you can expect help, it is likely you deserve it. Suck it up, Buttercup, and read this, this, and this before posting again.

  3. #3
    Registered User
    Join Date
    May 2009
    Posts
    4,183
    "...a computer is a stupid machine with the ability to do incredibly smart things, while computer programmers are smart people with the ability to do incredibly stupid things. They are,in short, a perfect match.." Bill Bryson

  4. #4
    Registered User
    Join Date
    Oct 2014
    Posts
    2
    Quote Originally Posted by grumpy View Post
    That is, reasonably obviously, a homework exercise - and this site has a homework policy here. You need to demonstrate a genuine attempt before expecting help. As yet, you have demonstrated no such attempt.
    Yes, it is part of a project that I would love to get help on, but this is only a small part of it. The entire homework assignment involves using the Hill Cipher to encrypt a message. The message I need to encrypt is very large and has a lot of different characters in it as well as uppercase letters. In order for me to encrypt my message I need to change the entire message to lowercase with no whitespace and I was just looking for help on how to do that. I have researched about how to do so on the internet but I can only find ways to do one or the other and not both together so I was hoping someone here would know how to do them all together.

  5. #5
    Registered User
    Join Date
    May 2009
    Posts
    4,183
    Quote Originally Posted by Riptidez View Post
    Yes, it is part of a project that I would love to get help on, but this is only a small part of it. The entire homework assignment involves using the Hill Cipher to encrypt a message. The message I need to encrypt is very large and has a lot of different characters in it as well as uppercase letters. In order for me to encrypt my message I need to change the entire message to lowercase with no whitespace and I was just looking for help on how to do that. I have researched about how to do so on the internet but I can only find ways to do one or the other and not both together so I was hoping someone here would know how to do them all together.
    So, you need to learn to program instead of copy and paste the work of others.

    Tim S.
    "...a computer is a stupid machine with the ability to do incredibly smart things, while computer programmers are smart people with the ability to do incredibly stupid things. They are,in short, a perfect match.." Bill Bryson

  6. #6
    Registered User
    Join Date
    Nov 2012
    Posts
    1,393
    Quote Originally Posted by Riptidez View Post
    I can only find ways to do one or the other and not both together.
    If you know how to do both separately, couldn't you use the solutions you've found one after the other? If you want the board to help you further, try your best attempt with what you know, show the code you've tried here and then ask for specific help on getting it to work. That way you'll learn more and the people here will probably be more motivated to help.

  7. #7
    Registered User
    Join Date
    Jan 2014
    Posts
    45
    It can help to break procedures into multiple simpler ones. Consider the following break-down.

    * Translate upper-case to lower-case characters in a string.
    * Remove characters, in a string, that are not lower-case.

    See whether you can write two functions that do these things, then combine them.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Changing a files lowercase characters to uppercase
    By jesterisdead in forum C Programming
    Replies: 9
    Last Post: 05-16-2014, 03:26 PM
  2. Replies: 1
    Last Post: 08-04-2013, 12:22 PM
  3. Count Uppercase and Lowercase Characters
    By ihackress in forum C Programming
    Replies: 4
    Last Post: 07-02-2013, 10:37 PM
  4. converting chars to uppercase/lowercase
    By Unregistered in forum C++ Programming
    Replies: 4
    Last Post: 05-08-2002, 07:55 PM
  5. C++ newbie..convert string from lowercase to uppercase
    By wireless in forum C++ Programming
    Replies: 5
    Last Post: 02-25-2002, 08:49 PM