Explode - Maple Help
For the best experience, we recommend viewing online help using Google Chrome or Microsoft Edge.

Online Help

All Products    Maple    MapleSim


StringTools

  

Explode

  

convert a string to a list of characters

  

Implode

  

convert a list of characters to a string

 

Calling Sequence

Parameters

Description

Examples

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

seqs

• 

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.

• 

All of the StringTools package commands treat strings as (null-terminated) sequences of 8-bit (ASCII) characters.  Thus, there is no support for multibyte character encodings, such as unicode encodings.

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