Go to: Synopsis. Return value. Related. MEL examples.

Synopsis

string[] stringToStringArray(string $string, string $separationString)

Break up the string argument into individual strings and return them all as elements in an array. The separation string identifies the characters used to distinguish between individual strings.

Return value

None

Related

stringArrayToString, tokenize

Arguments

Variable Name Variable Type Description
$stringstringThe string to break up into individual strings.
$separationStringstringDefines the characters that break up the individual strings.

MEL examples

	string $array[];

	$array = stringToStringArray("red blue green", " ");
	print ("// " + $array[0] + "\n");

	print ("// " + $array[1] + "\n");

	print ("// " + $array[2] + "\n");

	// red

	// blue

	// green


	$array = stringToStringArray("Hey, what's your name?", " ,?");
	print ("// " + $array[0] + "\n");

	print ("// " + $array[1] + "\n");

	print ("// " + $array[2] + "\n");

	print ("// " + $array[3] + "\n");

	// Hey

	// what's

	// your

	// name


	$array = stringToStringArray("/user/directory/documents/file", "/");
	print ("// " + $array[0] + "\n");

	print ("// " + $array[1] + "\n");

	print ("// " + $array[2] + "\n");

	print ("// " + $array[3] + "\n");

	// user

	// directory

	// documents

	// file