Blog

Page 749 of my articles, tutorials, and thoughts

Latest Articles

Cover Image for \d less efficient than [0-9]
c#performanceregex

\d less efficient than [0-9]

Published on September 2, 2023

šŸ“ **Title: The Mystery of Regex Efficiency: \d vs [0-9]** šŸ’” Introduction: Have you ever wondered about the efficiency of different regex expressions? Well, I stumbled upon an interesting question and decided to dig deeper. In a recent discussion, someon

Cover Image for JavaScriptSerializer - JSON serialization of enum as string
c#enumsjson

JavaScriptSerializer - JSON serialization of enum as string

Published on September 2, 2023

# Let's Serialize Enums in JavaScript Using JSON as a String! šŸš€ So you have an enum property in your class and you are serializing the object using `JavaScriptSerializer`. However, instead of getting the string representation of the enum in your JSON res

Cover Image for Multiline string literal in C#
c#string

Multiline string literal in C#

Published on September 2, 2023

šŸ“ **Create Multiline String Literals in C# with Ease!** šŸš€ Are you tired of writing long strings in C# and having to concatenate them line by line? šŸ¤” Well, fret no more! We've got a solution for you: multiline string literals in C#! šŸŽ‰ ## The Problem ļæ½

Cover Image for Create Generic method constraining T to an Enum
c#enumsgenerics

Create Generic method constraining T to an Enum

Published on September 2, 2023

šŸ“ **A Simple Guide to Creating a Generic Method Constrained to an Enum** Are you trying to build a function that extends the `Enum.Parse` concept? Do you want to allow a default value to be parsed in case an Enum value is not found? šŸ˜• One way to achiev

Cover Image for How to calculate difference between two dates (number of days)?
c#date

How to calculate difference between two dates (number of days)?

Published on September 2, 2023

# šŸ—“ļø How to Calculate the Difference Between Two Dates šŸ’” Have you ever wondered how to calculate the number of days between two dates in C#? šŸ¤” It's a common task that programmers encounter when working with date and time data. In this blog post, we'll

Cover Image for Send HTTP POST request in .NET
c#httprequest.net

Send HTTP POST request in .NET

Published on September 2, 2023

# How to Send an HTTP POST Request in .NET: A Quick and Simple Guide šŸš€ Are you a .NET developer looking to send an HTTP POST request and send data in the body? Look no further! In this blog post, we'll break down the process for you, address common issue

Cover Image for Best way to add comments in erb
commentsruby-on-rails

Best way to add comments in erb

Published on September 2, 2023

# šŸ’¬ Adding Comments in erb: The Ultimate Guide! Are you struggling with adding comments in erb files without having them show up in your HTML content? Don't worry, we've got you covered! šŸ’Ŗ In this blog post, we'll walk you through the best way to add co

Cover Image for Virtual member call in a constructor
c#constructor

Virtual member call in a constructor

Published on September 2, 2023

# šŸ•µļø Unveiling the Mystery of Virtual Member Calls in Constructors Are you puzzled about why ReSharper is flagging a virtual member call in your object's constructor? 🚩 Don't worry, you're not alone! This seemingly innocent warning can lead to some gnar

Cover Image for Path.Combine for URLs?
c#.netpathurl

Path.Combine for URLs?

Published on September 2, 2023

šŸ“ **Title: Path.Combine vs Url.Combine: Demystifying URL Concatenation in .NET Framework** šŸ“… **Introduction** Finding the right tool to concatenate URLs in the .NET framework can be a challenge. While Path.Combine is a commonly used function for combin

Cover Image for Why is Dictionary preferred over Hashtable in C#?
c#data-structures.net

Why is Dictionary preferred over Hashtable in C#?

Published on September 2, 2023

# šŸ“š Dictionary vs Hashtable: Which one should you use in C#? Have you ever come across the question of whether to use a dictionary or a hashtable in your C# code? You're not alone! It's a common dilemma that programmers face when it comes to implemen