View previous topic :: View next topic
|
Author |
Message |
anilsanda
New User
Joined: 07 Jun 2007 Posts: 15 Location: chennai
|
|
|
|
Hi,
I want to add spaces to a string when length of it is less than the required length.Is there any command to do this? |
|
Back to top |
|
|
acevedo
Active User
Joined: 11 May 2005 Posts: 344 Location: Spain
|
|
|
|
are you talking about Rexx?
you can concatenate strings using ||
Code: |
string1='I can't find the'
string2='Rexx manuals'
string3= string1 || string2 => string3 ='I can't find theRexx manuals'
or
string3= string1 ||' '|| string2 => string3 ='I can't find the Rexx manuals'
or
string3= string1 string2 => string3 ='I can't find the Rexx manuals'
|
;) |
|
Back to top |
|
|
acevedo
Active User
Joined: 11 May 2005 Posts: 344 Location: Spain
|
|
|
|
btw..., if Rexx, search for LEFT or COPIES... |
|
Back to top |
|
|
anilsanda
New User
Joined: 07 Jun 2007 Posts: 15 Location: chennai
|
|
|
|
consider this example:
if the string is "good luck" the length of the string is 9 but i want to increase the lenghth of this string to length of 30 by adding spaces after the last word in the string.
How can i do this |
|
Back to top |
|
|
acevedo
Active User
Joined: 11 May 2005 Posts: 344 Location: Spain
|
|
|
|
what you ask it could be done with just invoking the LEFT builtin in a proper way.
search, read and try it, then post any doubt you have. |
|
Back to top |
|
|
kavya123 Warnings : 1 New User
Joined: 11 Jul 2007 Posts: 34 Location: hyderabad
|
|
|
|
hey,
Code: |
str = 'good luck'
l= length(str)
str1=left(str,30,' ')
l1 = length(str1)
say l l1 |
Here l = 9 and l1 = 30. |
|
Back to top |
|
|
|