If I have three exact strings composed of "Hello world", what 'invisible'
char could I add to the string so I can distinguish between them? With
visible characters, it'd look something like this:
"#Hello world"
"@Hello word"
"$Hello world"
I'd like to replace the #, @, $ with invisible characters. These strings
will be displayed in a windows datagrid cell.
Thanks. 3 9318
> If I have three exact strings composed of "Hello world", what 'invisible' char could I add to the string so I can distinguish between them? With visible characters, it'd look something like this:
"#Hello world" "@Hello word" "$Hello world"
I'd like to replace the #, @, $ with invisible characters. These strings will be displayed in a windows datagrid cell.
Tabs? Spaces?
Anyway, you can distinguish between them with their reference, provided that
the strings are dynamically assembled. Multiple strings with the same
content are interned so that
object.Referenc eEquals("Hello World", "Hello World")
returns true, but
string d = "d";
object.Referenc eEquals("Hello World", "Hello Worl"+d)
should return false. Lets hope the compiler doesn't optimize the
concatenation away.
another way would to create a new class which holds the string and if you
create multiple objects of that class you can alway distinguish between
them.
--
cody
[Freeware, Games and Humor] www.deutronium.de.vu || www.deutronium.tk
Seems like a confusing post. Strings with the same content are not
necessarily interned. For the most part, only string literals are interned
while all other strings are left to their different references and storage
in memory.
As long as those Hello World's are coming out of a file, database,
user input, or pretty much anything other than being hard-coded into
the source, you are likely to use reference equality to tell the difference.
--
Justin Rogers
DigiTec Web Consultants, LLC.
Blog: http://weblogs.asp.net/justin_rogers
"cody" <pl************ *************@g mx.de> wrote in message
news:uI******** ******@TK2MSFTN GP11.phx.gbl... If I have three exact strings composed of "Hello world", what 'invisible' char could I add to the string so I can distinguish between them? With visible characters, it'd look something like this:
"#Hello world" "@Hello word" "$Hello world"
I'd like to replace the #, @, $ with invisible characters. These strings will be displayed in a windows datagrid cell.
Tabs? Spaces?
Anyway, you can distinguish between them with their reference, provided that the strings are dynamically assembled. Multiple strings with the same content are interned so that
object.Referenc eEquals("Hello World", "Hello World")
returns true, but
string d = "d"; object.Referenc eEquals("Hello World", "Hello Worl"+d)
should return false. Lets hope the compiler doesn't optimize the concatenation away.
another way would to create a new class which holds the string and if you create multiple objects of that class you can alway distinguish between them.
-- cody
[Freeware, Games and Humor] www.deutronium.de.vu || www.deutronium.tk
> Seems like a confusing post. Strings with the same content are not necessarily interned. For the most part, only string literals are interned while all other strings are left to their different references and storage in memory.
Thats what I meant. Only literals are interned. Dynamically created are
never interned unless you explicitly tell so using String.Intern() .
--
cody
[Freeware, Games and Humor] www.deutronium.de.vu || www.deutronium.tk This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: Mark |
last post by:
My PHP script builds a table that is too wide to fit on the paper. Two
of the columns contain strings that are more lengthy than data in the
other columns.
I can get the table to fit by letting the browser break the lengthy
strings across two or more lines, thus allowing the column to get
skinnier. I do this by inserting spaces in various places in the
string. But this is not a desirable solution as it would mislead the
user into...
|
by: NJSG |
last post by:
I'm creating a Dialog-Based Win32 file backup utility
for use with other application.
The problem is that I want to get the following in a
textbox:
doc1.txt: copied without errors.
doc2.txt: not copied!
doc3.txt: copied without errors.
doc4.txt: copied without errors.
but it does not recognize "\n". I had this problem in
Visual BASIC ( ~~ two years ago), and I didn't found re-
|
by: john |
last post by:
I have some controls that I want to be invisible, but if the user does
something, they will become visible using javascript. So I can't set
its "visible" property to false, because then they won't even be
rendered in the page at all. I can set them to invisible using
javascript, but I don't want to do that because then their visibility
isn't saved in the viewstate. Is there any way to make them invisible
from the code-behind file in a way...
|
by: Richard |
last post by:
After printing a userlist to a Datagrid i want some names not to be shown. I
want to know how i can make a entire datagrid row invisible.
I suspect its something with the OnItemDatabound but i am kinda stuck there.
but this is basicly what i want.
if Username = "Deleted_User" then
'make entire table row invisible.
End if
|
by: Arne |
last post by:
A lot of Firefox users I know, says they have problems with validation
where the ampersand sign has to be written as & to be valid. I don't
have Firefox my self and don't wont to install it only because of this,
so I hope some of you gurus can enlighten me with this :)
In what circumstances can the "&" in the source code be involuntary
changed to "&" by a browser when or other software, when editing and
uploading the file to the web...
| |
by: Derek Peschel |
last post by:
Should I add an RFE to SourceForge too? I'd like a wide audience in case
someone has enough experience to comment or is solving the same problem.
I'm using the urwid library which uses curses. On my system (Mac OS 10.3.7)
I specifically have ncurses. The programs I'm running turn off echoing and
set raw mode but don't disable interrupts. For development purposes I like
having interrupts, but my preferred keystrokes (WordStar) conflict...
|
by: harkon |
last post by:
Hi everybody!
I'm just wondering what it would take to make the following:
I have an invisible C# frame (opacity 0%) topmost placed, with no control boxes and even no border. Therefore this "layer" is completely invisible. But I can press the mouse on it and that is the problem.
I want to "grab through" this invisible frame and use controls of applications behind.
For example I want to use the scroll bars of the internet explorer behind...
|
by: WaterWalk |
last post by:
I've just read an article "Building Robust System" by Gerald Jay
Sussman. The article is here:
http://swiss.csail.mit.edu/classes/symbolic/spring07/readings/robust-systems.pdf
In it there is a footprint which says:
"Indeed, one often hears arguments against building exibility into an
engineered sys-
tem. For example, in the philosophy of the computer language Python it
is claimed:
\There should be one|and preferably only one|obvious...
|
by: Scott McNair |
last post by:
Hi,
I'm creating a user control that has absolutely no visual pieces to it...
it's essentially a piece that sniffs a serial port awaiting incoming data.
I know that there are several controls that come natively with .NET that
don't actually reside on the form, but go to the bottom area, such as for
example database-related controls. How would I go about setting my own
control to do just that? Otherwise I'm left with the quandary of...
|
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,...
|
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...
| |
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...
|
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...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules.
He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms.
Adolph will...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one.
At the time of converting from word file to html my equations which are in the word document file was convert into image.
Globals.ThisAddIn.Application.ActiveDocument.Select();...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
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
| |
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |