错误如下: CS0103: The name 'toAdresses' does not exist in the current context
在以下代码中:
public bool myFunction() { string toAddress; toAddress = "paul@gmail.com,jhon@gmail.com"; // for testing int firstCharacter = toAddress.IndexOf(','); if (firstCharacter != -1) { string[] toAdresses = toAddress.Split(','); } else { string[] toAdresses = new string[]{toAddress}; } for (int i = 0; i < toAdresses.Length; i++) // here is the error with toAdresses.Length { // do this } }
谢谢你的帮助!