FLResourceLibrary/FLCore/Extensions.cs
Dvurechensky 6e2bfe062d 1.0.1
2025-05-13 15:25:37 +03:00

28 lines
810 B
C#

/*
* Author: Nikolay Dvurechensky
* Site: https://www.dvurechensky.pro/
* Gmail: dvurechenskysoft@gmail.com
* Last Updated: 13 мая 2025 15:25:18
* Version: 1.0.1
*/
namespace FLCore
{
public static class Extensions
{
public static string ReplaceNegativeSymphols(this string val, string sym)
{
var index1 = val.IndexOf(sym);
var index2 = val.LastIndexOf(sym);
if (index1 != -1 && index2 != -1 && index1 < index2)
{
var f1 = val.Substring(0, index1);
var f2 = val.Substring(index1 + sym.Length, index2 - (index1 + sym.Length));
var f3 = val.Substring(index2 + sym.Length);
val = f1 + "«" + f2 + "»" + f3;
}
return val;
}
}
}