sozsoft-platform/api/src/Sozsoft.Platform.Domain/Extensions/StringExtensions.cs
Sedat Öztürk 429227df1d Initial
2026-02-24 23:44:16 +03:00

29 lines
704 B
C#

using System;
namespace Sozsoft.Platform.Extensions
{
public static class StringExtensions
{
public static string RemoveParentheses(this string str)
{
return str?.Replace("(", "").Replace(")", "");
}
public static string GetSegment(this string str, char segment, int index)
{
var start = str.NthIndexOf(segment, index);
if (start == -1)
{
return null;
}
start += 1;
var end = str.NthIndexOf(segment, index + 1);
if (end == -1)
{
return null;
}
return str[start..end];
}
}
}