python - Most efficient way to build single-element list from string with or without spaces? -


one way convert string single-element list in python is: my_string.split(). however, return list multiple elements if string has spaces. what's efficient way create list string may or may not have spaces?

how just

l = [my_string] 

Comments

Popular posts from this blog

How to mention the localhost in android -

php - Calling a template part from a post -

c# - String.format() DateTime With Arabic culture -