Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to make all letters in the string capital?

Tags:

ruby

I have a string from MD5 that looks like this:

@encrypted_str = Digest::MD5.hexdigest("1a2b3c").capitalize
=>Bf4ab447496f2d3d5a6c77c2cd12f996

but this .capitalize is making capital only first letter B

advice me please how to capitalize all letters in this MD5 result

like image 430
antsav Avatar asked Apr 20 '12 13:04

antsav


People also ask

How do you make all letters capital without retyping?

Look for the “Change Case” button on the Ribbon or use keyboard shortcuts after selecting text. In Word and Outlook for Windows hold SHIFT + F3 (tap to cycle) until the case you want is applied (if you have a laptop you may also need to hold the FN key).

How do you make all letters capital in Python?

In Python, upper() is a built-in method used for string handling. The upper() method returns the uppercased string from the given string. It converts all lowercase characters to uppercase.

How do you capitalize all words in a string in python?

upper() Return Value upper() method returns the uppercase string from the given string. It converts all lowercase characters to uppercase. If no lowercase characters exist, it returns the original string.


1 Answers

Try upcase:

@encrypted_str = Digest::MD5.hexdigest("1a2b3c").upcase
like image 128
Xaisoft Avatar answered Oct 11 '22 12:10

Xaisoft