mirror of
https://github.com/logos-storage/logos-storage-nim-cs-dist-tests.git
synced 2026-01-02 13:33:07 +00:00
17 lines
473 B
C#
17 lines
473 B
C#
namespace Utils
|
|
{
|
|
public static class Str
|
|
{
|
|
public static string Between(string input, string open, string close)
|
|
{
|
|
var openI = input.IndexOf(open);
|
|
if (openI == -1) return input;
|
|
var openIndex = openI + open.Length;
|
|
var closeIndex = input.LastIndexOf(close);
|
|
if (closeIndex == -1) return input;
|
|
|
|
return input.Substring(openIndex, closeIndex - openIndex);
|
|
}
|
|
}
|
|
}
|