Smith
Smith

Reputation: 5951

convert c# to vb.net

can anyone pls help me convert this to vb.net

for each (DictionaryEntry<String, Int64> entry in characterCounter)
{
  textBox1.Text += String.Format("char {0} occurs {1} times", entry.Key, entry.Value);
}

most of the free/online converter throw errors

Upvotes: 0

Views: 668

Answers (4)

hirendra
hirendra

Reputation: 11

For Each entry As DictionaryEntry In characterCounter
    textBox1.Text += String.Format("char {0} occurs {1} times", entry.Key, entry.Value)
Next

You can also try this online tool for converting c# to vb.net here: C# to VB

Upvotes: 0

Smith
Smith

Reputation: 5951

For Each entry As KeyValuePair(Of [String], Int64) In characterCounter
                txtSummary.Text += String.Format("char {0} occurs {1} times", entry.Key, entry.Value)
    Next

Upvotes: 0

Jon
Jon

Reputation: 16718

For Each entry As DictionaryEntry In characterCounter
    textBox1.Text += String.Format("char {0} occurs {1} times", entry.Key, entry.Value)
Next

Upvotes: 1

Darin Dimitrov
Darin Dimitrov

Reputation: 1038710

Try here: http://www.developerfusion.com/tools/convert/csharp-to-vb/

Of course this site assumes that you have valid C# code which is not your case. There is not such operator for each in C#. Also the DictionaryEntry class is not generic. Here's the automatic translation:

For Each entry As DictionaryEntry In characterCounter
    textBox1.Text += [String].Format("char {0} occurs {1} times", entry.Key, entry.Value)
Next

Upvotes: 1

Related Questions