摘要:
View Code static void FindTwoMins(int[] intArr, ref int firstMin, ref int secondMin) { if (intArr == null || intArr.Length <2) { throw new Exception("Input array can't be empty or less than 2"); } if (intArr[0]> intArr[1]) ... 阅读全文
摘要:
static string ReplaceChar(string str, char chr1, char chr2) { if (str == null || str == string.Empty) { throw new Exception("String input can not be null"); } string result = ""; for (int i = 0; i < str.Length; i++)... 阅读全文
摘要:
static string ReverseString(string str) { if (str == null || str.Length <= 1) { return str; } string result = ""; for (int i = str.Length - 1; i >= 0; i--) { result += str[i]; } ... 阅读全文