Soenneker.Extensions.Strings.Files
11.0.279
Prefix Reserved
dotnet add package Soenneker.Extensions.Strings.Files --version 11.0.279
NuGet\Install-Package Soenneker.Extensions.Strings.Files -Version 11.0.279
<PackageReference Include="Soenneker.Extensions.Strings.Files" Version="11.0.279" />
<PackageVersion Include="Soenneker.Extensions.Strings.Files" Version="11.0.279" />
<PackageReference Include="Soenneker.Extensions.Strings.Files" />
paket add Soenneker.Extensions.Strings.Files --version 11.0.279
#r "nuget: Soenneker.Extensions.Strings.Files, 11.0.279"
#:package Soenneker.Extensions.Strings.Files@11.0.279
#addin nuget:?package=Soenneker.Extensions.Strings.Files&version=11.0.279
#tool nuget:?package=Soenneker.Extensions.Strings.Files&version=11.0.279
Soenneker.Extensions.Strings.Files
Build timestamped, collision-resistant filenames from human-readable labels.
Installation
dotnet add package Soenneker.Extensions.Strings.Files
Create a filename
using Soenneker.Extensions.Strings.Files;
string fileName = "Quarterly Report".ToFileName("csv");
// QuarterlyReport-2026-08-30--14-22-05-<guid>.csv
ToFileName() removes whitespace and filename-invalid characters from the label and extension, adds a timestamp, and adds a GUID to prevent collisions. A leading dot on the extension is optional. Path separators in either input are removed, so the result is a filename rather than a caller-controlled path.
The timestamp uses the supplied time zone, or Eastern time when none is provided. The exact time and GUID are generated for each call.
Append a timestamp
string dated = "Daily Export".AppendDateTime();
string offsetDated = "Daily Export".AppendDateTimeOffset();
Both methods produce DailyExport-yyyy-MM-dd--HH-mm-ss. Pass timeZoneInfo to control the display zone, and pass utcNow when deterministic output is needed in tests.
These helpers sanitize individual filename components; they do not choose a directory, create a file, check reserved device names, or guarantee that the final path fits a filesystem's length limit. Combine the result with an application-controlled directory and apply any storage-specific policy before writing.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net11.0 is compatible. |
-
net11.0
- Soenneker.Extensions.DateTime (>= 11.0.1867)
- Soenneker.Utils.TimeZones (>= 11.0.784)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 11.0.279 | 226 | 11/19/2026 |
| 11.0.278 | 79 | 11/19/2026 |
| 11.0.277 | 73 | 11/19/2026 |
| 11.0.276 | 79 | 11/18/2026 |
| 11.0.274 | 87 | 11/18/2026 |
| 11.0.273 | 114 | 11/15/2026 |
| 11.0.272 | 94 | 11/14/2026 |
| 11.0.271 | 197 | 11/11/2026 |
| 11.0.269 | 88 | 11/11/2026 |
| 11.0.267 | 110 | 11/11/2026 |
| 11.0.266 | 91 | 11/11/2026 |
| 11.0.265 | 99 | 11/11/2026 |
| 11.0.264 | 84 | 11/10/2026 |
| 11.0.263 | 263 | 11/3/2026 |
| 11.0.262 | 95 | 11/3/2026 |
| 11.0.261 | 102 | 11/3/2026 |
| 11.0.260 | 98 | 11/2/2026 |
| 11.0.259 | 150 | 10/26/2026 |
| 11.0.258 | 95 | 10/26/2026 |
| 11.0.257 | 98 | 10/26/2026 |
Updated Multiple NuGet packages