473,791 Members | 3,154 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to Detect New Line character

Hi all,

I need to check whether my richtextbox contain any blank line. the source I
try to used in below. but it not reflect the output I need. basically I
need the collect the paragraph by paragraph text in a the rich text box to a
string array.

THEJAN


// Source
for(int counter=0; counter < tempArray.Lengt h;counter++)
{
string mask = "\r\n";
if (tempArray[counter] == mask)

{

MessageBox.Show ("Bingo I found a Blank Para Separation");
}

else

{

//MessageBox.Show (tempArray[counter]);

MessageBox.Show ("No New Line Found..");

}
}

Nov 15 '05 #1
2 11608
Hi, Thejan Mendis,

Maybe the Lines property is what you are looking for:

http://msdn.microsoft.com/library/en...linestopic.asp

Greetings
Martin
"Thejan Mendis" <tm*****@textce ntric.lk> wrote in message
news:O$******** ******@TK2MSFTN GP10.phx.gbl...
Hi all,

I need to check whether my richtextbox contain any blank line. the source I try to used in below. but it not reflect the output I need. basically I
need the collect the paragraph by paragraph text in a the rich text box to a string array.

THEJAN


// Source
for(int counter=0; counter < tempArray.Lengt h;counter++)
{
string mask = "\r\n";
if (tempArray[counter] == mask)

{

MessageBox.Show ("Bingo I found a Blank Para Separation");
}

else

{

//MessageBox.Show (tempArray[counter]);

MessageBox.Show ("No New Line Found..");

}
}

Nov 15 '05 #2
I found on the Microsoft site a MSDN TV show done by 'Alex
Kipman' which showed how MSBuild works, the link is
http://msdn.microsoft.com/msdntv/episode.aspx?
xml=episodes/en/20040122VSNETAK/manifest.xml

Basically Whidbey is totally integrated with MSBuild so
you only now need to understand the MSBuild script.

Thanks,
-----Original Message-----
Hi all,

I need to check whether my richtextbox contain any blank line. the source Itry to used in below. but it not reflect the output I need. basically Ineed the collect the paragraph by paragraph text in a the rich text box to astring array.

THEJAN


// Source
for(int counter=0; counter < tempArray.Lengt h;counter++)
{
string mask = "\r\n";
if (tempArray[counter] == mask)

{

MessageBox.Sho w("Bingo I found a Blank Para Separation");
}

else

{

//MessageBox.Show (tempArray[counter]);

MessageBox.Sho w("No New Line Found..");

}
}

.

Nov 15 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
4587
by: R. Rajesh Jeba Anbiah | last post by:
Here is a nice code to detect utf-8 <http://in2.php.net/utf8_encode#39986> But, I couldn't find out the logic behind the script. If anyone knows that please share. Particularly I would like to detect other encodings too. So, I would like to know the logic. For example these texts are in TSCII encoding (for Tamil): Žì¸õ. þÐ ¾Á¢Æ¢ø ¯ûÇ Åâ. þ¨¾ ¯í¸Ç¡ø ÀÊì¸ ÓÊó¾¡ø, ¯í¸û ¯Ä¡Å¢Â¢ø ±ó¾...
1
5401
by: Roy | last post by:
Hi, I have a problem that I have been working with for a while. I need to be able from server side (asp.net) to detect that the file i'm streaming down to the client is saved completely/succsessfully on the client's computer before updating some metadata on the server (file downloaded date for instance) However, All examples i have tried, and all examples I have found that other people says works - doesn't work for me :-(
2
4605
by: dever | last post by:
I checked my color printers's Printersettings.SupportsColor, which all showed false. What is wrong that I could not use this property. Also, what other way to detect if a printer is color printer. TIA
10
4080
by: Jonathan Smith | last post by:
I have a VB app that has a richtextbox with the word wrap set to true. I need to be able to output the text to a text file, but it just puts the text in the file as one long line. How do i replace word wrap (i.e. soft returns) with carriage returns?
13
28003
by: Michal | last post by:
Hello, is there any way how to detect string encoding in Python? I need to proccess several files. Each of them could be encoded in different charset (iso-8859-2, cp1250, etc). I want to detect it, and encode it to utf-8 (with string function encode). Thank you for any answer Regards Michal
2
4499
by: Dmitry Anikin | last post by:
I want to read stdin in chunks of fixed size until EOF I want to be able (also) to supply data interactively in console window and then to hit Ctrl+Z when finished So what I do is: while True: s = sys.stdin.read(chunk_size) if not s: break # do something with s
2
3512
by: sachinik19 | last post by:
Hi, We are using SAXParser (xerces) for parsing an xml with utf-8 encoding. For some special character it gives SAXException with error message - "The invalid character is found in the document ". But for other errors also it gives the same Exception only with different message. Is there any way to detect that the error is because of the invalid character in xml ? Or
0
2496
by: Robert Boone | last post by:
Is there any way to detect the real character set use in columns? I've just seen a mysql 4.0 database where the default character set was latin1 but greek was being inserted. When that database was upgraded to 4.1 the greek became unreadable. So I guess I'm asking how can I detect this so I can run a process on suspected databases and ALTER them to the correct character set. Thank you, Robert Boone
7
2655
by: Peter | last post by:
Hello I have an UTF string, how can i detect what language it is? thanks from Peter (cmk128@hotmail.com)
0
9517
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10428
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10207
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10156
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9030
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development projectplanning, coding, testing, and deploymentwithout human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5435
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5559
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3718
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2916
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.