Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kkosuge/1124975 to your computer and use it in GitHub Desktop.
Save kkosuge/1124975 to your computer and use it in GitHub Desktop.
# 配列風の文字列を配列にする方法
str = "[1,'hoge']"
ary = eval(str) #怖い....
ary = str[1..-2].split(',')
# なんかいい方法ないかな
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment