UtilTextFilesReplaceLines(String, String, IEnumerableInt32, String, TextDirection, Encoding) Method
Replaces the specified line numbesr in the source textfile with the given text-line,
then writes the result in the target textfile.
Namespace: DevCase.Core.DataProcessing.TextFilesAssembly: DevCase.net48 (in DevCase.net48.dll) Version: 6.0.0.0 (6.0)
XMLNS for XAML: Not mapped to an xmlns.
public static void ReplaceLines(
string sourceFilepath,
string targetFilepath,
IEnumerable<int> lineNumbers,
string text,
TextDirection textDirection,
Encoding enc = null
)
Public Shared Sub ReplaceLines (
sourceFilepath As String,
targetFilepath As String,
lineNumbers As IEnumerable(Of Integer),
text As String,
textDirection As TextDirection,
Optional enc As Encoding = Nothing
)
Dim sourceFilepath As String
Dim targetFilepath As String
Dim lineNumbers As IEnumerable(Of Integer)
Dim text As String
Dim textDirection As TextDirection
Dim enc As Encoding
UtilTextFiles.ReplaceLines(sourceFilepath,
targetFilepath, lineNumbers, text,
textDirection, enc)
public:
static void ReplaceLines(
String^ sourceFilepath,
String^ targetFilepath,
IEnumerable<int>^ lineNumbers,
String^ text,
TextDirection textDirection,
Encoding^ enc = nullptr
)
static member ReplaceLines :
sourceFilepath : string *
targetFilepath : string *
lineNumbers : IEnumerable<int> *
text : string *
textDirection : TextDirection *
?enc : Encoding
(* Defaults:
let _enc = defaultArg enc null
*)
-> unit
No code example is currently available or this language may not be supported.
Parameters
- sourceFilepath String
-
The source textfile path.
- targetFilepath String
-
The target textfile path.
- lineNumbers IEnumerableInt32
-
The index of the lines to replace.
- text String
-
The text-line to replace.
- textDirection TextDirection
-
The text direction.
- enc Encoding (Optional)
-
The file encoding used to read/write the textfile.
This is a code example.
No code example is currently available or this language may not be supported.
ReplaceLines("C:\old file.txt", "C:\new file.txt", {1, 2, 3}, "Text", UtilTextFiles.TextDirection.Top, Encoding.Default)
No code example is currently available or this language may not be supported.
No code example is currently available or this language may not be supported.
No code example is currently available or this language may not be supported.
No code example is currently available or this language may not be supported.