Click here to Skip to main content
15,890,123 members
Home / Discussions / C#
   

C#

 
QuestionGap detection Pin
viciouskinid27-May-09 22:16
viciouskinid27-May-09 22:16 
AnswerRe: Gap detection Pin
Rob Philpott28-May-09 0:02
Rob Philpott28-May-09 0:02 
QuestionProperty or indexer 'string.this[int]' cannot be assigned to -- it is read only Pin
Mohammad Dayyan27-May-09 22:16
Mohammad Dayyan27-May-09 22:16 
AnswerRe: Property or indexer 'string.this[int]' cannot be assigned to -- it is read only Pin
OriginalGriff27-May-09 22:26
mveOriginalGriff27-May-09 22:26 
GeneralRe: Property or indexer 'string.this[int]' cannot be assigned to -- it is read only Pin
Mohammad Dayyan27-May-09 22:30
Mohammad Dayyan27-May-09 22:30 
GeneralRe: Property or indexer 'string.this[int]' cannot be assigned to -- it is read only Pin
Mohammad Dayyan27-May-09 22:33
Mohammad Dayyan27-May-09 22:33 
AnswerRe: Property or indexer 'string.this[int]' cannot be assigned to -- it is read only Pin
Calla27-May-09 22:41
Calla27-May-09 22:41 
GeneralRe: Property or indexer 'string.this[int]' cannot be assigned to -- it is read only Pin
OriginalGriff27-May-09 22:58
mveOriginalGriff27-May-09 22:58 
Wouldn't use it if there was one (which there isn't, I don't think)!
Try this, if you are most comfortable with strings.
static void func(ref string bits)
    {
    StringBuilder sb = new StringBuilder();
    char Out;
    foreach (char c in bits)
        {
        if (RANDOM_NUM < MUTATION_RATE)
            {
            if (c == '1')
                Out = '0';
            else
                Out = '1';
            }
        else
            {
            Out = c;
            }
        sb.Append(Out);
        }
    bits = sb.ToString();
    }


You could use a System.Collections.BitArray, but it may be a little heavy-duty for what you are trying to do. Probably the proper way to do it though! Laugh | :laugh:

No trees were harmed in the sending of this message; however, a significant number of electrons were slightly inconvenienced.

This message is made of fully recyclable Zeros and Ones

AnswerRe: Property or indexer 'string.this[int]' cannot be assigned to -- it is read only Pin
Simon P Stevens27-May-09 22:34
Simon P Stevens27-May-09 22:34 
AnswerRe: Property or indexer 'string.this[int]' cannot be assigned to -- it is read only Pin
harold aptroot28-May-09 1:11
harold aptroot28-May-09 1:11 
QuestionRefreshing the system Pin
Rajdeep.NET is BACK27-May-09 22:13
Rajdeep.NET is BACK27-May-09 22:13 
AnswerRe: Refreshing the system Pin
OriginalGriff27-May-09 22:22
mveOriginalGriff27-May-09 22:22 
GeneralRe: Refreshing the system Pin
Rajdeep.NET is BACK27-May-09 22:35
Rajdeep.NET is BACK27-May-09 22:35 
GeneralRe: Refreshing the system Pin
DaveyM6927-May-09 22:44
professionalDaveyM6927-May-09 22:44 
GeneralRe: Refreshing the system Pin
Rajdeep.NET is BACK27-May-09 23:39
Rajdeep.NET is BACK27-May-09 23:39 
GeneralRe: Refreshing the system Pin
DaveyM6928-May-09 1:06
professionalDaveyM6928-May-09 1:06 
GeneralRe: Refreshing the system Pin
molesworth27-May-09 22:47
molesworth27-May-09 22:47 
GeneralRe: Refreshing the system Pin
Rajdeep.NET is BACK27-May-09 22:57
Rajdeep.NET is BACK27-May-09 22:57 
GeneralRe: Refreshing the system Pin
tom57200727-May-09 23:07
tom57200727-May-09 23:07 
GeneralRe: Refreshing the system Pin
Rajdeep.NET is BACK27-May-09 23:31
Rajdeep.NET is BACK27-May-09 23:31 
GeneralRe: Refreshing the system Pin
Anthony Mushrow27-May-09 23:34
professionalAnthony Mushrow27-May-09 23:34 
GeneralRe: Refreshing the system Pin
Dan Neely28-May-09 2:18
Dan Neely28-May-09 2:18 
GeneralRe: Refreshing the system Pin
harold aptroot27-May-09 23:35
harold aptroot27-May-09 23:35 
GeneralRe: Refreshing the system Pin
Rajdeep.NET is BACK27-May-09 23:45
Rajdeep.NET is BACK27-May-09 23:45 
GeneralRe: Refreshing the system Pin
padmanabhan N27-May-09 23:46
padmanabhan N27-May-09 23:46 

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.