{"id":1193,"date":"2023-03-28T10:59:47","date_gmt":"2023-03-28T03:59:47","guid":{"rendered":"https:\/\/csharptutorial.net\/?page_id=1193"},"modified":"2023-03-28T10:59:53","modified_gmt":"2023-03-28T03:59:53","slug":"csharp-write-text-files","status":"publish","type":"page","link":"https:\/\/www.csharptutorial.net\/csharp-file\/csharp-write-text-files\/","title":{"rendered":"C# Write Text Files"},"content":{"rendered":"\n<p><strong>Summary<\/strong>: in this tutorial, you&#8217;ll learn various techniques to write text files in C# using the <code>File<\/code> static methods and <code>StreamWriter<\/code> class.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Writing all text into a text file<\/h2>\n\n\n\n<p>The <code><code>File.WriteAllText<\/code>()<\/code> method creates a new file, writes the contents to it, and then closes the file:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-1\" data-shcb-language-name=\"C#\" data-shcb-language-slug=\"cs\"><span><code class=\"hljs language-cs\"><span class=\"hljs-function\"><span class=\"hljs-keyword\">public<\/span> <span class=\"hljs-keyword\">static<\/span> <span class=\"hljs-keyword\">void<\/span> <span class=\"hljs-title\">WriteAllText<\/span> (<span class=\"hljs-params\"><span class=\"hljs-keyword\">string<\/span> path, <span class=\"hljs-keyword\">string<\/span>? contents<\/span>)<\/span>;<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-1\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">C#<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">cs<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p>If the file specified by the path exists, the <code>WriteAllText()<\/code> method overwrites it. In other words, the contents of the existing file will be replaced by the contents.<\/p>\n\n\n\n<p>The following program demonstrates how to use <code><code>File.WriteAllText<\/code>()<\/code> method to write all text into a text file:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-2\" data-shcb-language-name=\"C#\" data-shcb-language-slug=\"cs\"><span><code class=\"hljs language-cs\"><span class=\"hljs-keyword\">using<\/span> <span class=\"hljs-keyword\">static<\/span> System.Console;\n\n<span class=\"hljs-keyword\">string<\/span> path = <span class=\"hljs-string\">@\"C:\\temp\\readme.txt\"<\/span>;\n<span class=\"hljs-keyword\">string<\/span> contents = <span class=\"hljs-string\">\"Hello\\nGoodbye\"<\/span>;\n\nFile.WriteAllText(path, contents);<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-2\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">C#<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">cs<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p>The <code>readme.txt<\/code> will look like the following:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-3\" data-shcb-language-name=\"C#\" data-shcb-language-slug=\"cs\"><span><code class=\"hljs language-cs\">Hello\nGoodbye<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-3\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">C#<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">cs<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p>This program writes the string &#8220;Hello&#8221; and &#8220;Goodbye&#8221; to the <code>readme.txt<\/code> file located in the &#8220;C:\\temp&#8221; directory.<\/p>\n\n\n\n<p>If the C:\\temp directory does not exist, the <code>WriteAllText()<\/code> method throws a <code>DirectoryNotFoundException<\/code>. <\/p>\n\n\n\n<p>For example, the following program attempts to write text to a file <code>readme.txt<\/code> located in the <code>C:\\temp1<\/code> directory. Since the directory <code>C:\\temp1<\/code> doesn&#8217;t exist, the program shows a message provided by the <code>DirectoryNotFoundException<\/code> object:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-4\" data-shcb-language-name=\"C#\" data-shcb-language-slug=\"cs\"><span><code class=\"hljs language-cs\"><span class=\"hljs-keyword\">using<\/span> <span class=\"hljs-keyword\">static<\/span> System.Console;\n\n<span class=\"hljs-keyword\">string<\/span> path = <span class=\"hljs-string\">@\"C:\\temp1\\readme.txt\"<\/span>;\n<span class=\"hljs-keyword\">string<\/span> contents = <span class=\"hljs-string\">\"Hello\\nGoodbye\"<\/span>;\n\n<span class=\"hljs-keyword\">try<\/span>\n{\n    File.WriteAllText(path, contents);\n}\n<span class=\"hljs-keyword\">catch<\/span> (DirectoryNotFoundException e)\n{\n    WriteLine(e.Message);\n}<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-4\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">C#<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">cs<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p>Output:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-5\" data-shcb-language-name=\"C#\" data-shcb-language-slug=\"cs\"><span><code class=\"hljs language-cs\">Could not find a part of the path <span class=\"hljs-string\">'C:\\temp1\\readme.txt'<\/span>.<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-5\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">C#<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">cs<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p>To check if the text file exists before writing the contents to it, you can use the <code><code>File.Exists<\/code>()<\/code> method like this:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-6\" data-shcb-language-name=\"C#\" data-shcb-language-slug=\"cs\"><span><code class=\"hljs language-cs\"><span class=\"hljs-keyword\">using<\/span> <span class=\"hljs-keyword\">static<\/span> System.Console;\n\n<span class=\"hljs-keyword\">string<\/span> path = <span class=\"hljs-string\">@\"C:\\temp\\readme.txt\"<\/span>;\n<span class=\"hljs-keyword\">string<\/span> contents = <span class=\"hljs-string\">\"Hello\\nGoodbye\"<\/span>;\n\n<span class=\"hljs-keyword\">if<\/span> (!File.Exists(path))\n{\n    File.WriteAllText(path, contents);\n}\n<span class=\"hljs-keyword\">else<\/span>\n{\n    WriteLine(<span class=\"hljs-string\">$\"The file <span class=\"hljs-subst\">{path}<\/span> alrady exists\"<\/span>);\n}<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-6\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">C#<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">cs<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p>Output:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-7\" data-shcb-language-name=\"C#\" data-shcb-language-slug=\"cs\"><span><code class=\"hljs language-cs\">The file C:\\temp\\readme.txt alrady exists<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-7\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">C#<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">cs<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<h2 class=\"wp-block-heading\">Writing one or more strings into a text file<\/h2>\n\n\n\n<p>To write one or more strings into a text file, you use the <code><code><code><code>File.WriteAllLines<\/code><\/code>()<\/code><\/code> method. The <code><code><code><code>File.WriteAllLines<\/code><\/code>()<\/code><\/code> method creates a new file, writes one or more strings to the file, and then closes the file:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-8\" data-shcb-language-name=\"C#\" data-shcb-language-slug=\"cs\"><span><code class=\"hljs language-cs\"><span class=\"hljs-function\"><span class=\"hljs-keyword\">public<\/span> <span class=\"hljs-keyword\">static<\/span> <span class=\"hljs-keyword\">void<\/span> <span class=\"hljs-title\">WriteAllLines<\/span> (<span class=\"hljs-params\">\n   <span class=\"hljs-keyword\">string<\/span> path, \n   <span class=\"hljs-keyword\">string<\/span>&#91;] contents\n<\/span>)<\/span>;<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-8\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">C#<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">cs<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p>For example:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-9\" data-shcb-language-name=\"C#\" data-shcb-language-slug=\"cs\"><span><code class=\"hljs language-cs\"><span class=\"hljs-keyword\">string<\/span> path = <span class=\"hljs-string\">@\"C:\\temp\\readme.txt\"<\/span>;\n\n<span class=\"hljs-keyword\">string<\/span>&#91;] lines = <span class=\"hljs-keyword\">new<\/span>&#91;] {\n    <span class=\"hljs-string\">\"Hello\"<\/span>,\n    <span class=\"hljs-string\">\"Hi\"<\/span>,\n    <span class=\"hljs-string\">\"Hey\"<\/span>\n};\n\nFile.WriteAllLines(path, lines);<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-9\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">C#<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">cs<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p>The <code>readme.txt<\/code> file will look like this:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-10\" data-shcb-language-name=\"C#\" data-shcb-language-slug=\"cs\"><span><code class=\"hljs language-cs\">Hello\nHi\nHey<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-10\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">C#<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">cs<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<h2 class=\"wp-block-heading\">Writing into a text file using StreamWriter<\/h2>\n\n\n\n<p>When you have a large amount of text data that you want to write into a text file in sequential order, you can use <code>StreamWriter<\/code>. For example:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-11\" data-shcb-language-name=\"C#\" data-shcb-language-slug=\"cs\"><span><code class=\"hljs language-cs\"><span class=\"hljs-keyword\">string<\/span> path = <span class=\"hljs-string\">@\"C:\\temp\\readme.txt\"<\/span>;\n\n<span class=\"hljs-comment\">\/\/ in practice, the greetings is very big<\/span>\n<span class=\"hljs-keyword\">string<\/span>&#91;] greetings = <span class=\"hljs-keyword\">new<\/span>&#91;] { <span class=\"hljs-string\">\"Hello\"<\/span>, <span class=\"hljs-string\">\"Hi\"<\/span>, <span class=\"hljs-string\">\"Hey\"<\/span> };\n\n<span class=\"hljs-keyword\">var<\/span> fs = <span class=\"hljs-keyword\">new<\/span> FileStream(path, FileMode.Open);\n<span class=\"hljs-keyword\">var<\/span> stream = <span class=\"hljs-keyword\">new<\/span> StreamWriter(fs);\n\n<span class=\"hljs-keyword\">foreach<\/span> (<span class=\"hljs-keyword\">var<\/span> greeting <span class=\"hljs-keyword\">in<\/span> greetings)\n{\n    <span class=\"hljs-comment\">\/\/ write each line to the stream<\/span>\n    stream.WriteLine(greeting);\n}<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-11\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">C#<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">cs<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p>How it works.<\/p>\n\n\n\n<p>First, define a string variable named &#8220;path&#8221; and assigns it the value of the file path C:\\temp\\<code>readme.txt<\/code> where we want to write the text.<\/p>\n\n\n\n<p>Next, create an array of strings named &#8220;greetings&#8221; that has three different strings &#8211; <code>\"Hello\",<\/code> <code>\"Hi\"<\/code>, and <code>\"Hey\"<\/code>.<\/p>\n\n\n\n<p>Then, create a <code>FileStream<\/code> object named fs that open the file specified by the path with the mode <code>FileMode<\/code>.Open. <\/p>\n\n\n\n<p>After that, create a <code>StreamWriter<\/code> object that writes text to the file using the <code>FileStream<\/code> object.<\/p>\n\n\n\n<p>Finally, iterate the greetings array and write each element into the file using the <code>StreamWriter<\/code> object.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Writing into a text file asynchronously<\/h2>\n\n\n\n<p>To write data into a text file asynchronously, you can use the <code><a href=\"https:\/\/csharptutorial.net\/csharp-concurrency\/csharp-async-await\/\">async<\/a><\/code> versions of the <code>WriteAllText<\/code> and <code>WriteAllLines()<\/code> methods:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-12\" data-shcb-language-name=\"C#\" data-shcb-language-slug=\"cs\"><span><code class=\"hljs language-cs\"><span class=\"hljs-function\"><span class=\"hljs-keyword\">public<\/span> <span class=\"hljs-keyword\">static<\/span> Task <span class=\"hljs-title\">WriteAllTextAsync<\/span> (<span class=\"hljs-params\"><span class=\"hljs-keyword\">string<\/span> path, <span class=\"hljs-keyword\">string<\/span>? contents, CancellationToken cancellationToken = <span class=\"hljs-keyword\">default<\/span><\/span>)<\/span>;\n<span class=\"hljs-function\"><span class=\"hljs-keyword\">public<\/span> <span class=\"hljs-keyword\">static<\/span> Task <span class=\"hljs-title\">WriteAllLinesAsync<\/span> (<span class=\"hljs-params\"><span class=\"hljs-keyword\">string<\/span> path, IEnumerable&lt;<span class=\"hljs-keyword\">string<\/span>&gt; contents, CancellationToken cancellationToken = <span class=\"hljs-keyword\">default<\/span><\/span>)<\/span>;<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-12\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">C#<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">cs<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p>For example:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-13\" data-shcb-language-name=\"C#\" data-shcb-language-slug=\"cs\"><span><code class=\"hljs language-cs\"><span class=\"hljs-keyword\">string<\/span> path = <span class=\"hljs-string\">@\"C:\\temp\\readme.txt\"<\/span>;\n\n<span class=\"hljs-keyword\">string<\/span>&#91;] greetings = <span class=\"hljs-keyword\">new<\/span>&#91;] {\n    <span class=\"hljs-string\">\"Hello\"<\/span>,\n    <span class=\"hljs-string\">\"Hi\"<\/span>,\n    <span class=\"hljs-string\">\"Hey\"<\/span>\n};\n\n<span class=\"hljs-keyword\">await<\/span> File.WriteAllLinesAsync(path, greetings);<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-13\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">C#<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">cs<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p>In this example, we use the <code>WriteAllLinesAsync()<\/code> method to asynchronously write the array of strings into a text file. <\/p>\n\n\n\n<p>Note that we use the <code>await<\/code> keyword to wait for the <code>WriteAllLinesAsync()<\/code> method to complete.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Summary<\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Use the <code><code>File.WriteAllText<\/code>()<\/code> method to write all text into a text file.<\/li>\n\n\n\n<li>Use the <code><code>File.WriteAllTextAsync<\/code>()<\/code> method to write text data into a text file asynchronously.<\/li>\n\n\n\n<li>Use the <code><code>File.WriteAllLines<\/code>()<\/code> method to write an array of strings into a text file.<\/li>\n\n\n\n<li>Use the <code><code>File.WriteAllLinesAsync<\/code>()<\/code> method to write an array of strings into a text file asynchronously.<\/li>\n\n\n\n<li>Use the <code>StreamWriter<\/code> to write a large amount of text into a text file.<\/li>\n<\/ul>\n<div class=\"helpful-block-content\" data-title=\"\">\n\t<header>\n\t\t<div class=\"wth-question\">Was this tutorial helpful ?<\/div>\n\t\t<div class=\"wth-thumbs\">\n\t\t\t<button\n\t\t\t\tdata-post=\"1193\"\n\t\t\t\tdata-post-url=\"https:\/\/www.csharptutorial.net\/csharp-file\/csharp-write-text-files\/\"\n\t\t\t\tdata-post-title=\"C# Write Text Files\"\n\t\t\t\tdata-response=\"1\"\n\t\t\t\tclass=\"wth-btn-rounded wth-yes-btn\"\n\t\t\t>\n\t\t\t\t<svg\n\t\t\t\t\txmlns=\"http:\/\/www.w3.org\/2000\/svg\"\n\t\t\t\t\tviewBox=\"0 0 24 24\"\n\t\t\t\t\tfill=\"none\"\n\t\t\t\t\tstroke=\"currentColor\"\n\t\t\t\t\tstroke-width=\"2\"\n\t\t\t\t\tstroke-linecap=\"round\"\n\t\t\t\t\tstroke-linejoin=\"round\"\n\t\t\t\t\tclass=\"feather feather-thumbs-up block w-full h-full\"\n\t\t\t\t>\n\t\t\t\t\t<path\n\t\t\t\t\t\td=\"M14 9V5a3 3 0 0 0-3-3l-4 9v11h11.28a2 2 0 0 0 2-1.7l1.38-9a2 2 0 0 0-2-2.3zM7 22H4a2 2 0 0 1-2-2v-7a2 2 0 0 1 2-2h3\"\n\t\t\t\t\t><\/path>\n\t\t\t\t<\/svg>\n\t\t\t\t<span class=\"sr-only\"> Yes <\/span>\n\t\t\t<\/button>\n\n\t\t\t<button\n\t\t\t\tdata-response=\"0\"\n\t\t\t\tdata-post=\"1193\"\n\t\t\t\tdata-post-url=\"https:\/\/www.csharptutorial.net\/csharp-file\/csharp-write-text-files\/\"\n\t\t\t\tdata-post-title=\"C# Write Text Files\"\n\t\t\t\tclass=\"wth-btn-rounded wth-no-btn\"\n\t\t\t>\n\t\t\t\t<svg\n\t\t\t\t\txmlns=\"http:\/\/www.w3.org\/2000\/svg\"\n\t\t\t\t\tviewBox=\"0 0 24 24\"\n\t\t\t\t\tfill=\"none\"\n\t\t\t\t\tstroke=\"currentColor\"\n\t\t\t\t\tstroke-width=\"2\"\n\t\t\t\t\tstroke-linecap=\"round\"\n\t\t\t\t\tstroke-linejoin=\"round\"\n\t\t\t\t>\n\t\t\t\t\t<path\n\t\t\t\t\t\td=\"M10 15v4a3 3 0 0 0 3 3l4-9V2H5.72a2 2 0 0 0-2 1.7l-1.38 9a2 2 0 0 0 2 2.3zm7-13h2.67A2.31 2.31 0 0 1 22 4v7a2.31 2.31 0 0 1-2.33 2H17\"\n\t\t\t\t\t><\/path>\n\t\t\t\t<\/svg>\n\t\t\t\t<span class=\"sr-only\"> No <\/span>\n\t\t\t<\/button>\n\t\t<\/div>\n\t<\/header>\n\n\t<div class=\"wth-form hidden\">\n\t\t<div class=\"wth-form-wrapper\">\n\t\t\t<div class=\"wth-title\"><\/div>\n\t\t\t\n\t\t\t<textarea class=\"wth-message\"><\/textarea>\n\n\t\t\t<button class=\"btn btn-primary wth-btn-submit\">Send<\/button>\n\t\t\t<button class=\"btn wth-btn-cancel\">Cancel<\/button>\n\t\t\n\t\t<\/div>\n\t<\/div>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>Summary: in this tutorial, you&#8217;ll learn various techniques to write text files in C# using the File static methods and StreamWriter class. Writing all text into a text file The File.WriteAllText() method creates a new file, writes the contents to it, and then closes the file: If the file specified by the path exists, the [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":1182,"menu_order":7,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-1193","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/www.csharptutorial.net\/wp-json\/wp\/v2\/pages\/1193","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.csharptutorial.net\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/www.csharptutorial.net\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/www.csharptutorial.net\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.csharptutorial.net\/wp-json\/wp\/v2\/comments?post=1193"}],"version-history":[{"count":4,"href":"https:\/\/www.csharptutorial.net\/wp-json\/wp\/v2\/pages\/1193\/revisions"}],"predecessor-version":[{"id":1197,"href":"https:\/\/www.csharptutorial.net\/wp-json\/wp\/v2\/pages\/1193\/revisions\/1197"}],"up":[{"embeddable":true,"href":"https:\/\/www.csharptutorial.net\/wp-json\/wp\/v2\/pages\/1182"}],"wp:attachment":[{"href":"https:\/\/www.csharptutorial.net\/wp-json\/wp\/v2\/media?parent=1193"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}