View previous topic :: View next topic
|
Author |
Message |
rajesh_mbt
New User
Joined: 27 Mar 2006 Posts: 97 Location: India
|
|
|
|
Can any one help me for the following question.
I want to remove the character value from input field to output field.
Example. A contains 10:20:22(Time) -Input field.
I want to remove the colon from A field and the result should be 102022.
Please let me know is there any function to acheive this. |
|
Back to top |
|
|
superk
Global Moderator
Joined: 26 Apr 2004 Posts: 4652 Location: Raleigh, NC, USA
|
|
|
|
In REXX (you didn't specify what language) you can use a combination of two functions: TRANSLATE (translate the colon to a space) and SPACE (to remove the resulting spaces):
/* REXX */
STR = TIME()
SAY STR
STR = SPACE(TRANSLATE(STR,'',':'),0)
SAY STR |
|
Back to top |
|
|
Marso
REXX Moderator
Joined: 13 Mar 2006 Posts: 1353 Location: Israel
|
|
|
|
I wanted to say that but as I am late here is another possibility (less efficient I think):
/* REXX */
STR = TIME()
SAY STR
PARSE VAR STR HH ':' MM ':' SS
STR = HH || MM || SS
SAY STR |
|
Back to top |
|
|
rajesh_mbt
New User
Joined: 27 Mar 2006 Posts: 97 Location: India
|
|
|
|
Moderator / Marso
This is working fine.... Thanks a lot for your help |
|
Back to top |
|
|
|