Tech C**P
15 subscribers
161 photos
9 videos
59 files
304 links
مدرس و برنامه نویس پایتون و لینوکس @alirezastack
Download Telegram
As you may know you can use capitalize to make the first letter of a word upper case. For example you can turn failed to Failed.

In Jinja2 you can use title to do the same job:

{{ "failed" | title }}

#python #jinja2 #filter #title #capitalize
If you want to implement "Python Capitalize" method in Go:

strings.Title(strings.ToLower("MYNAME")) // output: Myname


There is another method called ToTitle which is used for one character long (but to letters):

str := "dz"
fmt.Println(strings.ToTitle(str)) // output: Dz


#python #golang #go #ToLower #Title #strings #capitalize #ToTitle