Android Question How to remove Multiple Carriage return from string

junaidahmed

Well-Known Member
Licensed User
Longtime User
I have an EditText with multiple carriage return.I would like to know how to remove this multiple carriage return.Please advise.........
 

DonManfred

Expert
Licensed User
Longtime User
Have a look at the String methods... Trim, Replace....
 
Upvote 0

junaidahmed

Well-Known Member
Licensed User
Longtime User
I have check but not solved,Please check my below string with carriage return

" I have discussed with father and introduced a additional in/out entry system exclusively for roeckl
just to monitor overall situation on a daily basis. In order for this system to be effective and accurate,
we have to follow certain procedures. "
 
Upvote 0

junaidahmed

Well-Known Member
Licensed User
Longtime User
Thanks Klaus

see the below sample string which contain three carriage return and I have store in string variable and then I have replace the string as empty via "Repalce" command.Please check code also....
B4X:
StrMessage.Replace(Chr(13)," ")

assddffff
sdfgghhhhhh
sdfgghhhhhh
 
Upvote 0

stevel05

Expert
Licensed User
Longtime User
Use CRLF as the replacement target instead of Chr(13).
 
Upvote 0
Top