Click here to Skip to main content
15,888,081 members
Home / Discussions / C#
   

C#

 
AnswerRe: Regular expressions in C# Pin
whaka12-Mar-09 23:48
whaka12-Mar-09 23:48 
AnswerRe: Regular expressions in C# Pin
psi_u13-Mar-09 1:05
psi_u13-Mar-09 1:05 
AnswerRe: Regular expressions in C# Pin
#realJSOP13-Mar-09 2:26
mve#realJSOP13-Mar-09 2:26 
Questionstring reference type? Pin
__DukeNukem__12-Mar-09 23:25
__DukeNukem__12-Mar-09 23:25 
AnswerRe: string reference type? Pin
DaveyM6912-Mar-09 23:37
professionalDaveyM6912-Mar-09 23:37 
GeneralRe: string reference type? Pin
__DukeNukem__12-Mar-09 23:45
__DukeNukem__12-Mar-09 23:45 
GeneralRe: string reference type? Pin
DaveyM6912-Mar-09 23:59
professionalDaveyM6912-Mar-09 23:59 
GeneralRe: string reference type? Pin
Luc Pattyn13-Mar-09 3:10
sitebuilderLuc Pattyn13-Mar-09 3:10 
Hi Dave,


DaveyM69 wrote:
a string ... is a null terminated char array - i.e. each character is stored in ajacent memory locations with a null character at the end to dertermine where the string finishes


Not so. That is true for C/C++ but not Java/C#.
How else would this snippet output "len=2":

char c='\0';  // or (char)0
string s="";
s=s+c;
s=s+c;
log("len="+s.Length);


I don't think we are supposed to even know *how* strings get stored, it suffices to know strings are collections of characters and there aren't any special characters, so NULL is handled like everything else.

The good thing is string.Length seems to be an O(1) operation. So it suggests a length+content implementation, as was used in Pascal.

Smile | :)

Luc Pattyn [Forum Guidelines] [My Articles]

- before you ask a question here, search CodeProject, then Google
- the quality and detail of your question reflects on the effectiveness of the help you are likely to get
- use the code block button (PRE tags) to preserve formatting when showing multi-line code snippets


GeneralRe: string reference type? Pin
DaveyM6913-Mar-09 4:25
professionalDaveyM6913-Mar-09 4:25 
Questionvehicle tracking Pin
R.Krishnakumar12-Mar-09 23:14
R.Krishnakumar12-Mar-09 23:14 
AnswerRe: vehicle tracking Pin
Eddy Vluggen12-Mar-09 23:23
professionalEddy Vluggen12-Mar-09 23:23 
GeneralRe: vehicle tracking Pin
R.Krishnakumar12-Mar-09 23:39
R.Krishnakumar12-Mar-09 23:39 
GeneralRe: vehicle tracking Pin
Pete O'Hanlon12-Mar-09 23:49
mvePete O'Hanlon12-Mar-09 23:49 
GeneralRe: vehicle tracking Pin
stancrm13-Mar-09 0:05
stancrm13-Mar-09 0:05 
GeneralRe: vehicle tracking Pin
Eddy Vluggen13-Mar-09 1:33
professionalEddy Vluggen13-Mar-09 1:33 
AnswerRe: vehicle tracking Pin
Michael Bookatz13-Mar-09 0:30
Michael Bookatz13-Mar-09 0:30 
AnswerRe: vehicle tracking Pin
#realJSOP13-Mar-09 2:28
mve#realJSOP13-Mar-09 2:28 
QuestionRunning process under another user account Pin
Paddy Boyd12-Mar-09 23:12
Paddy Boyd12-Mar-09 23:12 
QuestionNeed Help in Developing Basic biometric software using C# and VERILOOK SDK 3.2 for a diploma level student Pin
RogerLum12-Mar-09 21:40
RogerLum12-Mar-09 21:40 
AnswerRe: Need Help in Developing Basic biometric software using C# and VERILOOK SDK 3.2 for a diploma level student Pin
0x3c012-Mar-09 21:45
0x3c012-Mar-09 21:45 
AnswerRe: Need Help in Developing Basic biometric software using C# and VERILOOK SDK 3.2 for a diploma level student Pin
Pete O'Hanlon12-Mar-09 23:38
mvePete O'Hanlon12-Mar-09 23:38 
QuestionMicrosoft.VisualBasic missing namespace Pin
Speedular12-Mar-09 21:33
Speedular12-Mar-09 21:33 
AnswerRe: Microsoft.VisualBasic missing namespace Pin
0x3c012-Mar-09 21:39
0x3c012-Mar-09 21:39 
GeneralRe: Microsoft.VisualBasic missing namespace Pin
Speedular13-Mar-09 1:39
Speedular13-Mar-09 1:39 
GeneralRe: Microsoft.VisualBasic missing namespace Pin
0x3c013-Mar-09 3:37
0x3c013-Mar-09 3:37 

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.