Ocelot/src/Ocelot/Infrastructure/Extensions/StringExtensions.cs
Tom Pallister 3ac9b3bd87
hacked together load balancing reroutes in fileconfig (#211)
* 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
2018-01-31 20:34:55 +00:00

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}/";
}
}
}