Replace '00' AND '0' with a '+' from inf file section Append new line to new INF
<p>Hi am learning C# and I have some .inf files (See sample below) and I need to be able to change the [Destinations] section where a line starts with either '00' or '0' with a '+'. I have tried using Regex.Replace but it is replace all entries where there is a '00' in a file. What would be nice but not essintial at this point would to keep both entries in the file. IE </p>

<pre><code>[Destinations]
0="National",N,N
+="National",N,N
0024195="Gabon Mobiles",I,IMT
+24195="Gabon Mobiles",I,IMT
</code></pre>

<p>But just replacing for now would be a massive help! Again thank you for any help on this. Please let me know if you any more info.</p>

<pre><code>[Carrier]
Name=BT Customer Commitment
ChargeStructure=1 Year 50K


[ChargeBands]
Loc=Local Rate Calls
Nat=National Rate Calls
dq1=Directory Enquiries
dq2=Directory Enquiries
dq3=Directory Enquiries
dq4=Directory Enquiries
dq5=Directory Enquiries

[ChargeRates]
Loc,E="Economy",0,1000,60000,990,2800,Nearest,100
Loc,S="Standard",0,1000,60000,2450,2800,Nearest,100
Loc,W="Weekend",0,1000,60000,690,2800,Nearest,100
Nat,E="Economy",0,1000,60000,3190,2800,Nearest,100
Nat,S="Standard",0,1000,60000,6390,2800,Nearest,100


[DailyRates]
Loc,0=0000:E,0800:S,1800:E
Loc,1=0000:E,0800:S,1800:E
Loc,2=0000:E,0800:S,1800:E
Loc,3=0000:E,0800:S,1800:E
Loc,4=0000:E,0800:S,1800:E

[Destinations]
0="National",N,N
00="International",I,IV
0024195="Gabon Mobiles",I,IMT
0024197="Gabon Mobiles",I,IMT
00242="Congo",I,IS
090610="Premium Rate",M,n
0906100="C &amp; W Premium Rate",M,n
</code></pre>

<p>This is as far as I have go with the C# code.</p>

<pre><code>private void button3_Click(object sender, EventArgs e)
{
   File.WriteAllText(txtnewtariff.Text, Regex.Replace(File.ReadAllText(txtcurrent.Text), "[00]", "+"));


}
</code></pre>
