View previous topic :: View next topic
|
Author |
Message |
amolj
New User
Joined: 08 Nov 2006 Posts: 21 Location: india
|
|
|
|
hi guys....
my requirement is to concatenate tow strings....
following is the
String1 = 'comment'
String2 = 'application'
string = string1 string2
this command inserts a single space in between two string... now my requirement is that string2 should start from 40th position in string as the max leg of the string can be 20...they should be seperated by spaces in string...
how can i do it.. please help |
|
Back to top |
|
|
banuradha
New User
Joined: 20 Dec 2006 Posts: 19 Location: India
|
|
|
|
amolj wrote: |
hi guys....
my requirement is to concatenate tow strings....
following is the
String1 = 'comment'
String2 = 'application'
string = string1 string2
this command inserts a single space in between two string... now my requirement is that string2 should start from 40th position in string as the max leg of the string can be 20...they should be seperated by spaces in string...
how can i do it.. please help |
Hi I just need to clarify the output you are expecting ,is it like the following one
|----------------------40char------------|
string = comment-------------|------------------|application
|<----string1------->| |<-string2-->| |
|
Back to top |
|
|
banuradha
New User
Joined: 20 Dec 2006 Posts: 19 Location: India
|
|
|
|
oops! output format got changed
Is it like this
|----------------------40char------------|
string = comment-------------|------------------|application
|<----string1------->| |<-string2-->| |
|
Back to top |
|
|
banuradha
New User
Joined: 20 Dec 2006 Posts: 19 Location: India
|
|
|
|
string =|----------------------40char------------|
string = comment-------------|------------------|application
string =|<----string1-------->|------------------|<-string2-->| |
|
Back to top |
|
|
amolj
New User
Joined: 08 Nov 2006 Posts: 21 Location: india
|
|
|
|
string =|<----string1-------->|------------------|<-string2-->|
<----20-------------> <-------20----->
right this the format of output |
|
Back to top |
|
|
amolj
New User
Joined: 08 Nov 2006 Posts: 21 Location: india
|
|
|
|
string =|<----string1-------->|------------------|<-string2-->|
string =|<----20------------->|<-------20---->| |
|
Back to top |
|
|
banuradha
New User
Joined: 20 Dec 2006 Posts: 19 Location: India
|
|
|
|
/*REXX*/
STRING1 = 'COMMENTS'
SPACESTRING ='____________________'
STRING2 = 'APPLICATION'
STRNG=STRING1||SPACESTRING
SAY STRNG
FINALSTRING = STRNG||STRING2
SAY FINALSTRING
Hope this might help you |
|
Back to top |
|
|
amolj
New User
Joined: 08 Nov 2006 Posts: 21 Location: india
|
|
|
|
banuradha wrote: |
/*REXX*/
STRING1 = 'COMMENTS'
SPACESTRING ='____________________'
STRING2 = 'APPLICATION'
STRNG=STRING1||SPACESTRING
SAY STRNG
FINALSTRING = STRNG||STRING2
SAY FINALSTRING
Hope this might help you |
hi banuradha ..
this would surely work...
but i foud out some other way .. thought of sharing it with u...
/*REXX*/
STRING1= 'COMMENTS'
STRING2='APPLICATION'
STRING1= LEFT(STRING1,39)
/*THIS WOULD ADD SPACES TO END OF THE STRING SO THAT */
/*LENGTH BECOME 39 */
STRING3=STRING1 STRING2
/*THIS CONCATENATES TWO STRING WITH SPACE IN BETWEEN*/
BYE.. |
|
Back to top |
|
|
|