<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>Tutorials on Blake Link</title>
    <link>https://blakelink.com/tutorials/</link>
    <description>Recent content in Tutorials on Blake Link</description>
    <generator>Hugo</generator>
    <language>en-us</language>
    <lastBuildDate>Mon, 22 Sep 2025 13:32:21 -0600</lastBuildDate>
    <atom:link href="https://blakelink.com/tutorials/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>How to Strip Newlines in Rust - A Complete Guide</title>
      <link>https://blakelink.com/tutorials/rust-strip-newlines/</link>
      <pubDate>Mon, 22 Sep 2025 13:32:21 -0600</pubDate>
      <guid>https://blakelink.com/tutorials/rust-strip-newlines/</guid>
      <description>&lt;p&gt;If you&amp;rsquo;re working with text in Rust, you&amp;rsquo;ve probably had to deal with the headache of unwanted newline characters. Whether you&amp;rsquo;re cleaning up user input, processing files, or wrangling API responses, newlines can be a real pain. The good news is that Rust&amp;rsquo;s standard library gives you some powerful, memory-safe, and efficient tools for handling them. In this guide, I&amp;rsquo;ll walk you through some of the best ways to strip newlines in Rust, with plenty of practical examples.&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to Strip Newlines in Go - A Complete Guide</title>
      <link>https://blakelink.com/tutorials/go-strip-newlines/</link>
      <pubDate>Mon, 22 Sep 2025 13:24:56 -0600</pubDate>
      <guid>https://blakelink.com/tutorials/go-strip-newlines/</guid>
      <description>&lt;p&gt;If you&amp;rsquo;re working with text in Go, you&amp;rsquo;ve probably had to deal with the headache of unwanted newline characters. Whether you&amp;rsquo;re cleaning up user input, processing files, or wrangling API responses, newlines can be a real pain. The good news is that Go&amp;rsquo;s standard library gives you some powerful and efficient tools for handling them. In this guide, I&amp;rsquo;ll walk you through some of the best ways to strip newlines in Go, with plenty of practical examples.&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to Strip Newlines in C# - A Complete Guide</title>
      <link>https://blakelink.com/tutorials/csharp-strip-newlines/</link>
      <pubDate>Mon, 22 Sep 2025 13:21:33 -0600</pubDate>
      <guid>https://blakelink.com/tutorials/csharp-strip-newlines/</guid>
      <description>&lt;p&gt;If you&amp;rsquo;re working with text in C#, you&amp;rsquo;ve probably run into the need to get rid of unwanted newline characters. Whether you&amp;rsquo;re cleaning up user input, processing files, or dealing with API responses, newlines can be a real pain. The good news is that C# and the .NET Framework give you some powerful tools for handling them. In this guide, I&amp;rsquo;ll walk you through some of the best ways to strip newlines in C#, with plenty of practical examples.&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to Strip Newlines in Java - A Complete Guide</title>
      <link>https://blakelink.com/tutorials/java-strip-newlines/</link>
      <pubDate>Mon, 22 Sep 2025 13:17:53 -0600</pubDate>
      <guid>https://blakelink.com/tutorials/java-strip-newlines/</guid>
      <description>&lt;p&gt;If you&amp;rsquo;re working with text in Java, you&amp;rsquo;ve probably had to deal with the headache of unwanted newline characters. Whether you&amp;rsquo;re cleaning up user input, processing files, or wrangling API responses, newlines can be a real pain. The good news is that Java gives you some powerful and efficient tools for handling them. In this guide, I&amp;rsquo;ll walk you through some of the best ways to strip newlines in Java, with plenty of practical examples.&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to Strip Newlines in JavaScript - A Complete Guide</title>
      <link>https://blakelink.com/tutorials/javascript-strip-newlines/</link>
      <pubDate>Mon, 22 Sep 2025 13:11:15 -0600</pubDate>
      <guid>https://blakelink.com/tutorials/javascript-strip-newlines/</guid>
      <description>&lt;p&gt;If you&amp;rsquo;re working with text in JavaScript, you&amp;rsquo;ve probably had to deal with the headache of unwanted newline characters. Whether you&amp;rsquo;re cleaning up user input, processing files, or wrangling API responses, newlines can be a real pain. The good news is that JavaScript gives you some powerful and efficient tools for handling them. In this guide, I&amp;rsquo;ll walk you through some of the best ways to strip newlines in JavaScript, with plenty of practical examples.&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to Strip Newlines in Ruby - A Complete Guide</title>
      <link>https://blakelink.com/tutorials/ruby-strip-newlines/</link>
      <pubDate>Mon, 13 Jan 2025 14:02:10 -0600</pubDate>
      <guid>https://blakelink.com/tutorials/ruby-strip-newlines/</guid>
      <description>&lt;p&gt;If you&amp;rsquo;re working with strings in Ruby, you&amp;rsquo;ve probably run into situations where you need to get rid of newline characters. Here are a few common scenarios:&lt;/p&gt;&#xA;&lt;h3 id=&#34;1-processing-files&#34;&gt;1. Processing Files&lt;/h3&gt;&#xA;&lt;p&gt;When you&amp;rsquo;re reading from a file, each line usually comes with a newline character at the end. You&amp;rsquo;ll want to strip these out when you&amp;rsquo;re working with things like:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;CSV files where newlines aren&amp;rsquo;t part of the actual data.&lt;/li&gt;&#xA;&lt;li&gt;Config files where newlines are just for formatting.&lt;/li&gt;&#xA;&lt;li&gt;Log files that you&amp;rsquo;re parsing for analysis.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-ruby&#34; data-lang=&#34;ruby&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#75715e&#34;&gt;# Example: Cleaning up a CSV file&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;require &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#39;csv&amp;#39;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#66d9ef&#34;&gt;def&lt;/span&gt; &lt;span style=&#34;color:#a6e22e&#34;&gt;clean_csv_data&lt;/span&gt;(filename)&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  &lt;span style=&#34;color:#75715e&#34;&gt;# Read the whole file and get rid of any extra newlines&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  raw_data &lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt; &lt;span style=&#34;color:#66d9ef&#34;&gt;File&lt;/span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;.&lt;/span&gt;read(filename)&lt;span style=&#34;color:#f92672&#34;&gt;.&lt;/span&gt;gsub(&lt;span style=&#34;color:#e6db74&#34;&gt;/\r\n?/&lt;/span&gt;, &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;&lt;/span&gt;&lt;span style=&#34;color:#ae81ff&#34;&gt;\n&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;&lt;/span&gt;)&lt;span style=&#34;color:#f92672&#34;&gt;.&lt;/span&gt;strip&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  &lt;span style=&#34;color:#75715e&#34;&gt;# Parse the cleaned-up CSV data&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  &lt;span style=&#34;color:#66d9ef&#34;&gt;CSV&lt;/span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;.&lt;/span&gt;parse(raw_data)&lt;span style=&#34;color:#f92672&#34;&gt;.&lt;/span&gt;map &lt;span style=&#34;color:#66d9ef&#34;&gt;do&lt;/span&gt; &lt;span style=&#34;color:#f92672&#34;&gt;|&lt;/span&gt;row&lt;span style=&#34;color:#f92672&#34;&gt;|&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    &lt;span style=&#34;color:#75715e&#34;&gt;# Strip whitespace and newlines from each field&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    row&lt;span style=&#34;color:#f92672&#34;&gt;.&lt;/span&gt;map { &lt;span style=&#34;color:#f92672&#34;&gt;|&lt;/span&gt;field&lt;span style=&#34;color:#f92672&#34;&gt;|&lt;/span&gt; field&lt;span style=&#34;color:#f92672&#34;&gt;&amp;amp;.&lt;/span&gt;strip }&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  &lt;span style=&#34;color:#66d9ef&#34;&gt;end&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#66d9ef&#34;&gt;end&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#75715e&#34;&gt;# How to use it&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#66d9ef&#34;&gt;begin&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  cleaned_data &lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt; clean_csv_data(&lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#39;sample.csv&amp;#39;&lt;/span&gt;)&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  puts &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;Processed &lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;#{&lt;/span&gt;cleaned_data&lt;span style=&#34;color:#f92672&#34;&gt;.&lt;/span&gt;size&lt;span style=&#34;color:#e6db74&#34;&gt;}&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt; rows&amp;#34;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#66d9ef&#34;&gt;rescue&lt;/span&gt; &lt;span style=&#34;color:#66d9ef&#34;&gt;Errno&lt;/span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;::&lt;/span&gt;&lt;span style=&#34;color:#66d9ef&#34;&gt;ENOENT&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  puts &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;Error: File not found&amp;#34;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#66d9ef&#34;&gt;end&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h3 id=&#34;2-handling-user-input&#34;&gt;2. Handling User Input&lt;/h3&gt;&#xA;&lt;p&gt;When you get input from a user with a method like &lt;code&gt;gets&lt;/code&gt;, it comes with a trailing newline that you&amp;rsquo;ll almost always want to remove.&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to Strip Newlines in Python - A Complete Guide</title>
      <link>https://blakelink.com/tutorials/python-strip-newlines/</link>
      <pubDate>Wed, 11 Dec 2024 14:03:14 -0600</pubDate>
      <guid>https://blakelink.com/tutorials/python-strip-newlines/</guid>
      <description>&lt;p&gt;If you&amp;rsquo;re working with text in Python, you&amp;rsquo;ve probably had to deal with the headache of unwanted newline characters. Whether you&amp;rsquo;re cleaning up user input, processing files, or wrangling scraped data, newlines can be a real pain. The good news is that Python gives you some powerful and efficient tools for handling them. In this guide, I&amp;rsquo;ll walk you through some of the best ways to strip newlines in Python, with plenty of practical examples.&lt;/p&gt;</description>
    </item>
  </channel>
</rss>
