When trying to make a string an expression I see some wrong results:
str = "one Test String to see"
(* "one Test String to see" *)
str //ToExpression
(* one see String Test to *)
What is the correct way to do that to avoid the mess up?
Thanks!
UPDATE
I am expecting to have following output:
one Test String to see
UPDATE 1
As @ Mr.Wizard said
ToExpression[str, StandardForm, HoldForm]
Does what I want. Now if I have two strings (lot's of in reality)
{"one Test String to see", "300/1"}
How can I do to perform ToExpression[str] on the element that contains numbers, and ToExpression[str, StandardForm, HoldForm] on the one that is string only?
UPDATE 2
To be clear let me bring an example. Let's say I have following string:
a = "{a -> some String here, b -> 3/5, c -> {1, 2, 4, 6}}"
(* "{a -> some String here, b -> 3/5, c -> {1, 2, 4, 6}}" *)
Now I want to bring this to list of rules to have following output (nothing is code here)
{a -> here some String, b -> 3/5, c -> {1, 2, 4, 6}}
OrderlessonTimesyou will need a hold function, e.g.ToHeldExpressionorMakeExpression. (Or to hide the hold functionToExpression[str, StandardForm, HoldForm].) However these may still not do what you want, whatever that is, as other kinds of parsing still take place. – Mr.Wizard Mar 29 '15 at 10:552/3 cmcontainscmwhich would be parsed as a Symbol;{1, 2, 3}would be parsed as aList; is this correct? Please see my comment below the answer also. – Mr.Wizard Mar 29 '15 at 11:38a // ToExpressionis your solution. I am sorry but I am going to stop trying to understand this problem. Perhaps someone else will have an easier time interpreting your needs. :-/ – Mr.Wizard Mar 29 '15 at 12:44