こんにちは、次のコードがあります。
static void CalcWordchange()
{
List<string[]> l = new List<string[]>
{
new string[]{Question1, matcheditalian1},
new string[]{"Sam", matcheditalian2},
new string[]{"clozapine", matcheditalian3},
new string[]{"flomax", matcheditalian4},
new string[]{"toradol", matcheditalian5},
};
foreach (string[] a in l)
{
int cost = LevenshteinDistance.Compute(a[0], a[1]);
errorString = String.Format("To change your input: \n {0} \n into the correct word: \n {1} \n you need to make: \n {2} changes \n ".Replace("\n", Environment.NewLine),
a[0],
a[1],
cost);
}
}
ボタンがクリックされるたびに、foreach ループ内のテキストが実行され、1 つの文 (リストの最後の項目) が出力されます。私がしたいのは、5つのアイテムすべてを文字列に出力することです。
4 つの新しい変数 (errorString2、3 など) を追加しましたが、それを出力する方法がわかりません。
どんな助けでも大歓迎です、ありがとう