StringTools - Maple Help

Online Help

All Products    Maple    MapleSim


Home : Support : Online Help : Programming : Names and Strings : StringTools Package : WhiteSpace Utilities : StringTools/ExpandTabs

StringTools

  

ExpandTabs

  

expand tabs to specified tab stops

 

Calling Sequence

Parameters

Description

Examples

Calling Sequence

ExpandTabs( s, tabs )

Parameters

s

-

Maple string; string to be expanded

tabs

-

{posint,list(posint)}; (optional) tab stop specification

Description

• 

The procedure ExpandTabs replaces tab characters in a string with spaces according to a given tab stop specification.

• 

The tab stop specification must be either a positive integer, or a strictly increasing list of positive integers. If the tab stop is a positive integer n, then tabs are set every n columns. If the tab stop specification is a list [n1,n2,...,nk], then tabs are set at columns n1, n2, ..., and nk. The default value for the optional second argument is the positive integer 8.

• 

A string is returned in which tabs in the original input string s have been replaced by spaces to the indicated tab stops; the input string is not modified.

Examples

withStringTools:

ExpandTabsa b c d e

a b c d e

(1)

ExpandTabsa b c d e,8

a b c d e

(2)

ExpandTabsa b c d e,4

a b c d e

(3)

ExpandTabsa b c d e,2,4,8,16,32,64

a b c d e

(4)

ExpandTabsa b c d e,2,4,8

a b c d e

(5)

ExpandTabsa b c d e,2,4,8,16,32,64

a b c d e

(6)

The following are errors because the lists of tab stops are not strictly increasing.

ExpandTabsa b c d e,2,8,4

Error, (in StringTools:-ExpandTabs) tab stops must be strictly increasing

ExpandTabsa b c d e,2,8,8

Error, (in StringTools:-ExpandTabs) tab stops must be strictly increasing

See Also

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