‎2010 Jan 27 6:26 PM
What is the fewest lines of code needed to transform:
'this is a test--have a look'
with
'this is a test'
the idea is to find the '--' in the string and blank out everything after that.
Thank-You
‎2010 Jan 27 7:23 PM
How though was it ?
DATA: lv_low TYPE string VALUE 'this is a test--have a look',
lv_c(35) TYPE c.
SPLIT lv_low AT '--' INTO lv_low lv_c.
CLEAR lv_c.
CONCATENATE lv_low lv_c INTO lv_low.
WRITE lv_low.
‎2010 Jan 27 6:40 PM
‎2010 Jan 27 6:58 PM
Rob, I try to use this forum quite seriously. If my question was incomplete you can let me know.
Otherwise, I suggest you read "The Rules of Engagement"
Step 5: Answering a question
The community lives by people like you, trying to help others. When you see an unanswered question where you think you can answer, do so and help the poster. Remember to be polite and if you do not completely understand a question and need more details, request more information from the poster.
Thank-You.
‎2010 Jan 27 7:24 PM
>
> Rob, I try to use this forum quite seriously. If my question was incomplete you can let me know.
>
> Otherwise, I suggest you read "The Rules of Engagement"
>
> Step 5: Answering a question
> The community lives by people like you, trying to help others. When you see an unanswered question where you think you can answer, do so and help the poster. Remember to be polite and if you do not completely understand a question and need more details, request more information from the poster.
>
> Thank-You.
Good point - let me explain
I don't think the rules of engagement say this, (at least I don't see it) but if you expect a good answer, you have to ask a good question. I think that if you check, you'll see that my answer completely and correctly answers the question that you actually asked. (I tested it.)
But to be fair, my answer was meant to ask to think about what you are asking and why you are asking such a question. Is your server so limited in storage space that you have to be concerned about the physical size of programs. Or is the question meant to be performance related? Or something else entirely?
But also to be fair, you have asked almost 500 questions and seem to be asking the forum a question that you really ought to think about yourself. Those rules of engagement also talk about searching for a solution before asking and explaining what you have done to find a solution in your question.
Rob
‎2010 Jan 27 7:52 PM
What is the fewest lines of code needed to transform:
I think the exact answer is 1 LOC ( Lines of code) as said by Rob.
@Tom - Its a FAQ, you should have searched.
‎2010 Jan 27 7:23 PM
How though was it ?
DATA: lv_low TYPE string VALUE 'this is a test--have a look',
lv_c(35) TYPE c.
SPLIT lv_low AT '--' INTO lv_low lv_c.
CLEAR lv_c.
CONCATENATE lv_low lv_c INTO lv_low.
WRITE lv_low.