WolframLang: Convert String

By Xah Lee. Date: . Last updated: .

Number to String

ToString

Convert number or any expression to string.

ToString

String to Number

ToExpression

String to number.

ToExpression

ToExpression[ "3" ] === 3
ToExpression[ "3.21" ] === 3.21

String to List

StringSplit

split a string to a list of strings.

StringSplit

(* split by whitespace *)
StringSplit[ "a b" ] === {"a", "b"}
(* split by comma *)
StringSplit[ "a,b,c", "," ] === {"a", "b", "c"}

List to String

StringRiffle

List to string.

StringRiffle

StringRiffle[ {"a" , "b" , "c"}, " " ] ===
"a b c"

WolframLang String