开发者

convert c# to vb.net

开发者 https://www.devze.com 2023-02-10 06:38 出处:网络
can anyone pls help me convert this to vb.net for each (DictionaryEntry<String, Int64> entry in characterCounter)

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);
}
开发者_StackOverflow中文版

most of the free/online converter throw errors


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


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


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


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

0

精彩评论

暂无评论...
验证码 换一张
取 消