mirror of
https://github.com/nsnail/Ocelot.git
synced 2025-04-30 08:22:50 +08:00

* hacked together load balancing reroutes in fileconfig * some renaming and refactoring * more renames * hacked away the old config json * test for issue 213 * renamed key * dont share ports * oops * updated docs * mvoed docs around * port being used
33 lines
801 B
C#
33 lines
801 B
C#
using System;
|
|
|
|
namespace Ocelot.Infrastructure.Extensions
|
|
{
|
|
public static class StringExtensions
|
|
{
|
|
public static string TrimStart(this string source, string trim, StringComparison stringComparison = StringComparison.Ordinal)
|
|
{
|
|
if (source == null)
|
|
{
|
|
return null;
|
|
}
|
|
|
|
string s = source;
|
|
while (s.StartsWith(trim, stringComparison))
|
|
{
|
|
s = s.Substring(trim.Length);
|
|
}
|
|
|
|
return s;
|
|
}
|
|
|
|
public static string LastCharAsForwardSlash(this string source)
|
|
{
|
|
if(source.EndsWith('/'))
|
|
{
|
|
return source;
|
|
}
|
|
|
|
return $"{source}/";
|
|
}
|
|
}
|
|
} |