Write a program to split and join a string with a hyphen delimiter


Topic: Write a program to split and join a string with a hyphen delimiter

Solution

str1 = "part of speech"
delimiter = "-"
list_str = str1.split(" ")
new_str = delimiter.join(list_str)
print("Delimited String is: " + new_str)



List all Python Programs