Click here to Skip to main content
15,914,416 members
Home / Discussions / C#
   

C#

 
GeneralRe: saving file problem Pin
Skippums23-Jan-08 4:36
Skippums23-Jan-08 4:36 
GeneralRe: saving file problem Pin
AliNajjar23-Jan-08 12:16
AliNajjar23-Jan-08 12:16 
GeneralJava/C# Interop Pin
Edmundisme22-Jan-08 12:45
Edmundisme22-Jan-08 12:45 
GeneralTelling a thread to do something. Pin
Clive D. Pottinger22-Jan-08 12:14
Clive D. Pottinger22-Jan-08 12:14 
GeneralRe: Telling a thread to do something. Pin
Luc Pattyn22-Jan-08 14:40
sitebuilderLuc Pattyn22-Jan-08 14:40 
GeneralRe: Telling a thread to do something. Pin
mav.northwind22-Jan-08 22:57
mav.northwind22-Jan-08 22:57 
GeneralRe: Telling a thread to do something. Pin
Clive D. Pottinger23-Jan-08 3:43
Clive D. Pottinger23-Jan-08 3:43 
General(XNA!!!) Have Several Sprites of the Same Image, With Different Properties [modified] Pin
MasterSharp22-Jan-08 11:32
MasterSharp22-Jan-08 11:32 
GeneralRe: (XNA!!!) Have Several Sprites of the Same Image, With Different Properties Pin
MarkB77722-Jan-08 17:34
MarkB77722-Jan-08 17:34 
GeneralHelp with playing 24-bit audio Pin
kshet2622-Jan-08 11:31
kshet2622-Jan-08 11:31 
GeneralRaise event from DLL Pin
GeezerJoe22-Jan-08 11:15
GeezerJoe22-Jan-08 11:15 
GeneralDelete/Update MS Outlook appointments Pin
NewToAspDotNet22-Jan-08 10:10
NewToAspDotNet22-Jan-08 10:10 
Generalhandling multi-threading in C#.net 3.0 Pin
anumadhu22-Jan-08 9:31
anumadhu22-Jan-08 9:31 
GeneralRe: handling multi-threading in C#.net 3.0 Pin
Skippums22-Jan-08 10:40
Skippums22-Jan-08 10:40 
Generalstring Pin
simworld22-Jan-08 8:39
simworld22-Jan-08 8:39 
GeneralRe: string Pin
J$22-Jan-08 8:42
J$22-Jan-08 8:42 
GeneralRe: string Pin
NewToAspDotNet22-Jan-08 10:08
NewToAspDotNet22-Jan-08 10:08 
GeneralRe: string Pin
Scott Dorman22-Jan-08 17:56
professionalScott Dorman22-Jan-08 17:56 
There are several ways you can compare strings in C#. The simplest way is to just test using equality:
C#
string a = "This is a test";
string b = "This is another test";
 
if (a == b) {
   // do something
}
However, this will do a case-sensistive, culture-sensitive compare which may not be what you want and isn't necessarily the most performant test.

The closest methods to strcmp in C# are going to be the String.Compare, String.CompareOrdinal or the String.CompareTo methods.

In order to copy a string, you can simply copy it. Strings in C# are immutable, so you will always get a new instance of the string:
C#
string a = "This is a test";
string b = a;
You can find all of the string methods here[^].

Scott.

—In just two days, tomorrow will be yesterday.
—Hey, hey, hey. Don't be mean. We don't have to be mean because, remember, no matter where you go, there you are. - Buckaroo Banzai

[Forum Guidelines] [Articles] [Blog]

GeneralRe: string Pin
simworld23-Jan-08 5:19
simworld23-Jan-08 5:19 
QuestionHow to send parameters to a running application? Pin
Gene Arnold22-Jan-08 8:19
Gene Arnold22-Jan-08 8:19 
AnswerRe: How to send parameters to a running application? Pin
Gene Arnold22-Jan-08 8:32
Gene Arnold22-Jan-08 8:32 
Generalget a BSTR from a vc++ dll to a c# string Pin
Calvin Streeting22-Jan-08 7:45
Calvin Streeting22-Jan-08 7:45 
GeneralRe: get a BSTR from a vc++ dll to a c# string Pin
led mike22-Jan-08 8:15
led mike22-Jan-08 8:15 
GeneralRe: get a BSTR from a vc++ dll to a c# string Pin
Calvin Streeting22-Jan-08 8:36
Calvin Streeting22-Jan-08 8:36 
GeneralRe: get a BSTR from a vc++ dll to a c# string Pin
led mike22-Jan-08 11:34
led mike22-Jan-08 11:34 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.