public void DeleterOddOfFile() { FileWork ClassPut = new FileWork(Arr); string[] ArrFile = ClassPut.ReadArrayFromBinaryFile(Arr); for (int i = 0; i < ArrFile.Length; i++) { if (Convert.ToInt32(ArrFile[i]) % 2 != 0) { ArrFile[i] = ""; } } for (int i = 0; i < ArrFile.Length; i++) { if (Convert.ToString(ArrFile[i]) == " ") { DeleterThisAndMove(ref ArrFile, i); } } string str = ""; for (int i = 0; i < ArrFile.Length; i++) { str += ArrFile[i] + Environment.NewLine; } ClassPut.WriteArrayToBinaryFile(str); }
public void DeleterEvenOfFile() { FileWork ClassPut = new FileWork(Arr); string[] ArrFile = ClassPut.ReadArrayFromBinaryFile(Arr); for (int i = 0; i < ArrFile.Length; i++) { if (Convert.ToInt32(ArrFile[i]) % 2 == 0) { ArrFile[i] = ""; } } string str = ""; for (int i = 0; i < ArrFile.Length; i++) { str += ArrFile[i] + Environment.NewLine; } ClassPut.WriteArrayToBinaryFile(str); }