Skip to content

Commit

Permalink
Add string extension
Browse files Browse the repository at this point in the history
  • Loading branch information
dstegelman committed Dec 23, 2024
1 parent a52fdef commit 6687bde
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
2 changes: 1 addition & 1 deletion CsuChhs.Extensions/CsuChhs.Extensions.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<Nullable>enable</Nullable>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<Authors>CHHS Application Development Team</Authors>
<Version>1.5.2</Version>
<Version>1.5.3</Version>
<PackageProjectUrl>https://github.com/csu-chhs/CsuChhs.Extensions</PackageProjectUrl>
<Company>College of Health and Human Sciences</Company>
<PackageId>CsuChhs.Extensions</PackageId>
Expand Down
11 changes: 11 additions & 0 deletions CsuChhs.Extensions/StringExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,17 @@ public static string ToTwelveHourTime(this string value)
return $"{newTime.Value}:{value.Substring(2)} {amPm2}";
}

/// <summary>
/// Convert string into a URL encoded string. Safe to
/// put in URLS
/// </summary>
/// <param name="value"></param>
/// <returns></returns>
public static string ToUrlEncodedString(this string value)
{
return Uri.EscapeDataString(value);
}

/// <summary>
/// Converts a possible URL without scheme into
/// one with an acceptable scheme.
Expand Down

0 comments on commit 6687bde

Please sign in to comment.