473,946 Members | 16,896 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Char Enumerator

In C# is there some sort of Enumerator which has "friendly" names for things like line feed, tabs, carriage control, etc.? I would perfer to use then using ascii values as I think this is more self documenting...
Nov 18 '05 #1
1 1368
C# like c/java/javascript has the time honored literal values

\n = new line (
\r = carriage return
\t = tab
see docs for more

you can make you own class with string props for the names if you want, but
then string constants would be as hard to read as the vb ones:

string s = StringValues.TA B + "this is line 1 " + StringValues.Ne wLine
+ StringValues.TA B + "this is line 1 " + StringValues.Ne wLine;

instead of:

string s = "\tthis is line1\r\n\tthis is line 2\r\n";

-- bruce (sqlwork.com)
"Jim Heavey" <Ji*******@disc ussions.microso ft.com> wrote in message
news:B6******** *************** ***********@mic rosoft.com...
In C# is there some sort of Enumerator which has "friendly" names for

things like line feed, tabs, carriage control, etc.? I would perfer to use
then using ascii values as I think this is more self documenting...
Nov 18 '05 #2

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

Similar topics

2
1581
by: Gordon Rundle | last post by:
It drives me nuts that I can't use foreach with an enumerator instance. I would like the following to be functionally identical: foreach (Object o in MyCollection) ... foreach (Object o in MyCollection.GetEnumerator()) ... For enumerable types that are under my control, is there any reason not to create an enumerator type that itself implements IEnumerable? Like so: class MyEnumerator : IEnumerable, IEnumerator {
2
1513
by: Stephanie Stowe | last post by:
Hi. I am trying to understand the weird System.DirectoryServices object model. I have a DirectoryEntry object. I want to enumerate through the PropertyCollection. So I looked at GetEnumerator. Lovely. My memory cannot dredge up how to use an enumerator. I do not understand the documentation, whcih does not contain little code snippets of examples like MSDN Oct 2001 for older technologies did. Can someone give me an enumerator basics 101...
5
8040
by: Flip | last post by:
I'm trying to create a form which a user can type out a key, and the CTRL-ALT-SHIFT keys are recognized (via ModifiedKeys object) and then pass the letter the user pressed to the windows API method for setting the hotkey. My problem is that WIN API takes a Keys object/enumeration. I'm a bit weak on that stuff, so I'm hoping someone can point me in the right direction? I'm looking for a good link or just out right help, please? If I...
11
7719
by: rawCoder | last post by:
Hi, Which is better in terms of performance. Iterating over Enumerator ForNext loop (using indexer) ForEach loop Thanx rawCoder
5
5248
by: toldyouso | last post by:
The following script works in IE but in Firefox errors with the msg Enumerator is not defined. <html> <head> <meta name="vs_defaultClientScript" content="JavaScript"> <script language="javascript"> <!-- function Recalc(){ var objHidden; var objControl;
8
2276
by: Henning M | last post by:
Hi, I'm trying to use stringbuilder to collect a list of strings. (as suggested by Claes Bergefall) Declare Auto Function CM_Get_Device_ID_List Lib "cfgmgr32.dll" (ByVal pszFilter As String, ByVal ptChar As System.Text.StringBuilder, ByVal bufferLen As Integer, ByVal ulFlags As Integer) As Integer Dim sb As New StringBuilder(len + 1)
7
1807
by: csharpula csharp | last post by:
Hello, I have methods which refer to some class enumerator .Should I make it pulic or encapsulate it? *** Sent via Developersdex http://www.developersdex.com ***
6
7494
by: Michael C | last post by:
I'm reading about Iterators and the article I'm reading states that an enumerator must load all of the objects into memory, which is obviously a big waste if there are a large number of objects and you only need a few of them. On the other hand the iterator does not need to load more than 1 object hence uses less memory. But can't you do the same thing with an enumerator just by returning the next object when Current is called? If that's...
7
3064
by: Bill Davy | last post by:
I want to be able to write (const char*)v where v is an item of type Class::ToolTypeT where ToolTypeT is an enumeration and I've tried everything that looks sensible. There's an ugly solution, but surely this is possible? I could define an operator<< but for various reasons, I really want to convert to a 'const char*' (to embed into a string which becomes part of a window's caption, etc).
0
10151
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9980
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
11556
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
11151
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...
0
10685
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9884
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 project—planning, coding, testing, and deployment—without 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
6328
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4933
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
3538
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.