Skip to content

Instantly share code, notes, and snippets.

@rklec
rklec / StringExtensions.cs
Last active May 4, 2026 19:34
StringExtensions -> TruncateInMiddle for Stackexchange
using System;
/// <summary>
/// Common extensions for manipulating strings.
/// </summary>
public static class StringExtensions
{
/// <summary>
/// This truncates/abbreviates the string and places the separator as a user-facing indicator <i>in the middle</i> of that string.
/// </summary>