Replacing New Line character by Empty String

82 views
Skip to first unread message

Bhagavati Kanta Dasa

unread,
Nov 17, 2014, 1:33:45 PM11/17/14
to mitappinv...@googlegroups.com
This may be a stupid question and I was trying to look at the tutorials and documentation but could not find this specific one.
I am reading text from files and they contain new-line characters. In my app I want to replace them with empty string or with som other character.
I tried using 'replace all text" block with the segment "\n" but it does not replace at all. I always see the new line character on the output string.
Don't know if this is a bug or I am not able to use it correctly.Thank you.
- Raj

Taifun

unread,
Nov 17, 2014, 2:05:28 PM11/17/14
to mitappinv...@googlegroups.com
It would really help if you provided a screenshot of your relevant blocks, so we can see what you are trying to do, and where the problem may be.

Taifun

Trying to push the limits of App Inventor! Snippets and Tutorials from Pura Vida Apps by Taifun.         

Bhagavati Kanta Dasa

unread,
Nov 18, 2014, 4:03:12 PM11/18/14
to mitappinv...@googlegroups.com
Thank you Taifun.!
I made more investigation and found out the fact.
Attached is the screenshot of the blocks.
If the file has just CR at the end of lines it does not work (obviously), and it works for LF and CRLF at the end of the lines.
Thank you..
This can be closed now.
- Raj
Screen Shot 2014-11-18 at 3.57.27 PM.png
file_with_crlf.txt
file_with_cr.txt
file_with_lf.txt
Screen Shot 2014-11-18 at 4.01.41 PM.png
Reply all
Reply to author
Forward
0 new messages