convert a string to a list of characters - Maple Help

Online Help

All Products    Maple    MapleSim


Home : Support : Online Help : Programming : Names and Strings : StringTools Package : List Conversions : StringTools/Explode

StringTools[Explode] - convert a string to a list of characters

StringTools[Implode] - convert a list of characters to a string

Calling Sequence

Explode( s )

Implode( stringList )

Parameters

s

-

string

stringList

-

list of strings

Description

• 

The Explode(s) function converts string s into a list of its individual characters.

  

If s is empty, then an empty list is returned. Otherwise, the list consisting of the characters comprising s, in order, is returned. Each string in the returned list has length equal to one (i.e., each string in the list is a single character string).

  

This procedure is equivalent to

seqt,t=s

• 

The Implode(stringList) function is the inverse of the Explode(s) function.

  

If stringList is empty, then the empty string is returned. Otherwise, the catenation of the one-character strings in stringList is returned.

  

This procedure is equivalent to

stringListcat"",seqs1,s=stringList

  

Note: The strings in stringList are all assumed to have length equal to one (whether this is, in fact, true or not). Only the first character of each string is used.

Examples

withStringTools:

Explode

(1)

ExplodeABC

A,B,C

(2)

ExplodeBang Your Box

B,a,n,g, ,Y,o,u,r, ,B,o,x

(3)

Implode

(4)

Implodea,b,c

abc

(5)

See Also

cat, seq, string, StringTools


Download Help Document

Was this information helpful?



Please add your Comment (Optional)
E-mail Address (Optional)
What is ? This question helps us to combat spam