Skip to content

Latest commit

 

History

History
21 lines (16 loc) · 334 Bytes

File metadata and controls

21 lines (16 loc) · 334 Bytes

ucfirst

Capitalizing the first character in a string is done in Ruby using the String#capitalize method.

{{code:php print ucfirst("hello world"); // => Hello world }}

{{code:ruby puts "hello world".capitalize # => Hello world }}

{{related: strings/strtolower strings/strtoupper strings/ucwords }}