0
可能重複:
How do I convert a Ruby string with brackets to an array?將字符串轉換爲一個類似陣列的字符串爲一個陣列中的Ruby
在紅寶石,如何將字符串時該字符串變換到一個數組看起來像一個數組聲明? 有沒有相當於「eval」的方法?我想避免拆分方法是這種情況。
例如,
的myString = 「[[ '喬伊', '男性', '[email protected]],[' 珍妮」, '女', '[email protected]']]」
'[email protected]應該是'[email protected]'。 – steenslag 2011-04-20 15:39:36