Hey, there! Golang enthusiastics. I hope you are putting effort in the Golang journey. This week we are improving the learning by using Go’s internal packages. We are using string package.

Problem Statement

Write a function that takes a string as input and returns the string with the first letter of each word capitalized. The words are separated by spaces.

Breaking down the problem statement: we have an input—a string of words separated by spaces. We need to process each word to capitalize its first letter. Finally, our output will be the same string, but processed.

Now it’s time to define our algorithm to process the string and obtain the requested output.

Algorithm to Solve it

First, we need to split the whole string into words. Thi…

Similar Posts

Loading similar posts...

Keyboard Shortcuts

Navigation
Next / previous item
j/k
Open post
oorEnter
Preview post
v
Post Actions
Love post
a
Like post
l
Dislike post
d
Undo reaction
u
Recommendations
Add interest / feed
Enter
Not interested
x
Go to
Home
gh
Interests
gi
Feeds
gf
Likes
gl
History
gy
Changelog
gc
Settings
gs
Browse
gb
Search
/
General
Show this help
?
Submit feedback
!
Close modal / unfocus
Esc

Press ? anytime to show this help