sh_19_ string into and splicing

 

sh_19_ string into and splicing

# Assumptions: The following is captured from the network 
# Requirements: 
# 1. string removed all whitespace 
# 2 reuse "" as the delimiter, spliced into a neat string 
poem_str = " Gordon Stork House Sparrow \ t the Audio \ t sun mountains \ t \ n Yellow River flows into the sea \ t \ t For a grander sight \ t \ t \ n the next level " 

Print (poem_str) 

# 1. split string 
= poem_list poem_str.split ()
 Print (poem_list) 

# 2. The combined character string 
Result = "  " .join (poem_list)
 Print (Result)

 

Guess you like

Origin www.cnblogs.com/shaohan/p/11519386.html