-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathMain.cs
More file actions
29 lines (27 loc) · 748 Bytes
/
Main.cs
File metadata and controls
29 lines (27 loc) · 748 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
//
// Main.cs
//
// Author:
// Mārcis Pinnis <marcis.pinnis@gmail.com>
//
// Copyright (c) 2013 Mārcis Pinnis
//
// This program can be freely used only for scientific and educational purposes.
//
// This program is distributed in the hope that it will be useful, but
// WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
using System;
using System.IO;
using System.Text;
namespace ReplaceStringInFile
{
class MainClass
{
public static void Main (string[] args)
{
string text = File.ReadAllText(args[0],Encoding.UTF8);
File.WriteAllText(args[1],text.Replace(args[2],args[3]),new UTF8Encoding(false));
}
}
}