‎2007 Jun 14 12:10 PM
Hi,
How to remove a space in a string ?
st = ' hai'.
I want to remove front and back spaces .
If there any function ?
Bye,
Satya.
‎2007 Jun 14 12:11 PM
Hi
use CONDENSE command
condence str.
will remove the spaces
Reward points for useful Answers
Regards
Anji
‎2007 Jun 14 12:13 PM
‎2007 Jun 14 12:14 PM
Hi,
Try this code,
SHIFT st RIGHT DELETING TRAILING SPACE
Thanks.
Reward If Helpful.
‎2007 Jun 14 12:15 PM
Hi,
The CONDENSE statement deletes redundant spaces from a string:
CONDENSE <c> [NO-GAPS].
This statement removes any leading blanks in the field <c> and replaces other sequences of
blanks by exactly one blank. The result is a left-justified sequence of words, each separated by
one blank. If the addition NO-GAPS is specified, all blanks are removed.
DATA: STRING(25) VALUE ' one two three four',
LEN TYPE I.
LEN = STRLEN( STRING ).
WRITE: STRING, '!'.
WRITE: / 'Length: ', LEN.
CONDENSE STRING.
LEN = STRLEN( STRING ).
WRITE: STRING, '!'.
WRITE: / 'Length: ', LEN.
CONDENSE STRING NO-GAPS.
LEN = STRLEN( STRING ).
WRITE: STRING, '!'.
WRITE: / 'Length: ', LEN.
Output:
one two three four !
Length: 25
one two three four !
Length: 18
onetwothreefour !
Length: 15
Note that the total length of the field STRING remains unchanged, but that the
deleted blanks appear again on the right.
Regards,
Bhaskar
‎2007 Jun 14 12:20 PM
Hi ,
My problem is We are taking values from java program . They are sending in String Format for the Quantity field. We have to take the values and we have to update in our database. In our database quntatiy field is with packed decimal with 3 digits in after decimals.
How we can convert it ?
Bye,
Satya.
‎2007 Jun 14 12:21 PM