User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the C# section within the Software Development category of DaniWeb, a massive community of 391,990 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 4,309 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our C# advertiser:
Views: 726 | Replies: 6 | Solved
Reply
Join Date: Mar 2008
Posts: 14
Reputation: SubProf is an unknown quantity at this point 
Rep Power: 1
Solved Threads: 0
SubProf's Avatar
SubProf SubProf is offline Offline
Newbie Poster

remove unwanted character from textbox

  #1  
Jun 6th, 2008
Hello,

I have a textbox which I write data out to. I use "\n" to make sure that the next line of data is written on a new line. This works but I keep getting an unwanted character at the end of each line of data written. It looks like a small square - I think its because I'm using "\n". Does anyone know how to get rid of this character or a better way to write the data to new lines.

Thanks in advance

SubProf
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Aug 2006
Location: Egypt
Posts: 759
Reputation: RamyMahrous is on a distinguished road 
Rep Power: 4
Solved Threads: 57
Featured Poster
RamyMahrous's Avatar
RamyMahrous RamyMahrous is offline Offline
Master Poster

Re: remove unwanted character from textbox

  #2  
Jun 6th, 2008
Your TextBox is multiline or isn't??
B.Sc Computer Science, Helwan University
Microsoft Student Partner
Personal blog http://ramymahrous.blogspot.com/
Arabic technical blog http://fci-h-ar.blogspot.com/
English technical blog http://fci-h.blogspot.com/
Reply With Quote  
Join Date: Mar 2008
Posts: 14
Reputation: SubProf is an unknown quantity at this point 
Rep Power: 1
Solved Threads: 0
SubProf's Avatar
SubProf SubProf is offline Offline
Newbie Poster

Re: remove unwanted character from textbox

  #3  
Jun 6th, 2008
Yes the textbox is multiline
Reply With Quote  
Join Date: Aug 2006
Location: Egypt
Posts: 759
Reputation: RamyMahrous is on a distinguished road 
Rep Power: 4
Solved Threads: 57
Featured Poster
RamyMahrous's Avatar
RamyMahrous RamyMahrous is offline Offline
Master Poster

Re: remove unwanted character from textbox

  #4  
Jun 6th, 2008
Just small question, you read text from file and then write it to textbox?? or what?
Last edited by RamyMahrous : Jun 6th, 2008 at 11:44 am.
B.Sc Computer Science, Helwan University
Microsoft Student Partner
Personal blog http://ramymahrous.blogspot.com/
Arabic technical blog http://fci-h-ar.blogspot.com/
English technical blog http://fci-h.blogspot.com/
Reply With Quote  
Join Date: Mar 2008
Posts: 14
Reputation: SubProf is an unknown quantity at this point 
Rep Power: 1
Solved Threads: 0
SubProf's Avatar
SubProf SubProf is offline Offline
Newbie Poster

Re: remove unwanted character from textbox

  #5  
Jun 6th, 2008
I read from a html file into a textbox
Reply With Quote  
Join Date: Aug 2006
Location: Egypt
Posts: 759
Reputation: RamyMahrous is on a distinguished road 
Rep Power: 4
Solved Threads: 57
Featured Poster
RamyMahrous's Avatar
RamyMahrous RamyMahrous is offline Offline
Master Poster

Re: remove unwanted character from textbox

  #6  
Jun 6th, 2008
Look, I tried it myself it works fine without replacing anything, Just I read text file using this
  1. string str = File.ReadAllText(filePath);
  2. textbox.Text = str;
No additional characters added!!
May be you should provide non-unicoding in ReadAllText method.
Last edited by RamyMahrous : Jun 6th, 2008 at 12:07 pm.
B.Sc Computer Science, Helwan University
Microsoft Student Partner
Personal blog http://ramymahrous.blogspot.com/
Arabic technical blog http://fci-h-ar.blogspot.com/
English technical blog http://fci-h.blogspot.com/
Reply With Quote  
Join Date: Mar 2008
Posts: 14
Reputation: SubProf is an unknown quantity at this point 
Rep Power: 1
Solved Threads: 0
SubProf's Avatar
SubProf SubProf is offline Offline
Newbie Poster

Re: remove unwanted character from textbox

  #7  
Jun 9th, 2008
That works!

Thank you

SubProf
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

DaniWeb C# Marketplace
Thread Tools Display Modes

Other Threads in the C# Forum

All times are GMT -4. The time now is 9:45 am.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC