304 North Cardinal St.
Dorchester Center, MA 02124
You are given a string. Split the string on a
" " (space) delimiter and join using a
The first line contains a string consisting of space separated words.
Print the formatted string as explained above.
this is a string
String Split and Join - Hacker Rank Solution
Using the split and join methods, we can solve this challenge.
def split_and_join(line): line = line.split(" ") line = "-".join(line) return line
def split_and_join(line): return line.replace(' ', '-')
In our experience, we suggest you solve this String Split and Join Hacker Rank Solution and gain some new skills from Professionals completely free and we assure you will be worth it.
I hope this String Split and Join Hacker Rank Solution would be useful for you to learn something new from this problem. If it helped you then don’t forget to bookmark our site for more Hacker Rank, Leetcode, Codechef, Codeforce Solution.
This Problem is intended for audiences of all experiences who are interested in learning about Data Science in a business context; there are no prerequisites.
More Hacker Rank Problem & Solutions >>