Skip to content

How to split a string to two other variable? (for time parsing) #11786

Answered by eli-schwartz
mobin-2008 asked this question in Q&A
Discussion options

You must be logged in to vote
a_parts = a.split('.')
message(a_parts[0])
message(a[0])

Objects are immutable, the split method doesn't operate on "a" and turn "a" into an array -- the split method returns a value that needs to be assigned.

Replies: 1 comment 7 replies

Comment options

You must be logged in to vote
7 replies
@mobin-2008
Comment options

@eli-schwartz
Comment options

@mobin-2008
Comment options

@eli-schwartz
Comment options

Answer selected by mobin-2008
@mobin-2008
Comment options

@eli-schwartz
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants