This is my first post as a trial in the Code Academy courses.
I was trying to figure out how to use the .gsub method for removing stuff like periods commas and that kind of stuff. I got it to kind work using this;
words = text.to_s.gsub(/[^a-z0-9\s]/, ’ ')
but I noticed it was also removing capital letters so I tried to search around. The ruby /ruby-doc.org was not very helpful and I was wondering if someone new a solid resource for ruby.
Anyways any insight on how I can keep the capital letters while only removing the punctuation.
Thanks in advance.
Looks like I found a way around it with
words = text.downcase
but if theres an easier way to do this in the .gsub method I’d love to know.