Scilab Home Page | Wiki | Bug Tracker | Forge | Mailing List Archives | Scilab Online Help | ATOMS
File : Details

add blanks to a string

Adds a specified number of blanks to front, back or both of a string
(1485 downloads for this version - 1485 downloads for all versions)
Details
Version
1.0
Author
david adams
Maintainer
David Adams
Category
License
Supported Scilab Version
5.3
Creation Date
February 24, 2011
Description
             addblanks - adds blanks to front or back of a string

 INPUTS:  
        Input_string - obviously a string
        N - number of spaces to add
        side: 1 - front
              2 - Back 
              3 - both            
Files (1)
[874 bytes]
Miscellaneous file
Scilab script
News (0)
Comments (1)
Comment from Allan Cornet -- February 24, 2011, 06:16:21 AM    
Hi,
good small function ;)

Some advice about your code:
replaces :
code2str(ones(1,pad)*40) by blanks
(help blanks)

input argument are not really checked in this first version
ex: addblanks('toto',4,1,'blabla')

Allan