file scoped namespaces (#565)

This commit is contained in:
Aleh Khantsevich
2025-02-16 11:54:23 +01:00
committed by GitHub
parent cf9869b71e
commit 3ddc1a6229
617 changed files with 32107 additions and 32721 deletions

View File

@@ -1,22 +1,21 @@
using System;
namespace Wino.Core.Extensions
{
public static class StringExtensions
{
public static bool Contains(this string source, string toCheck, StringComparison comp)
{
return source?.IndexOf(toCheck, comp) >= 0;
}
namespace Wino.Core.Extensions;
public static string ReplaceFirst(this string text, string search, string replace)
public static class StringExtensions
{
public static bool Contains(this string source, string toCheck, StringComparison comp)
{
return source?.IndexOf(toCheck, comp) >= 0;
}
public static string ReplaceFirst(this string text, string search, string replace)
{
int pos = text.IndexOf(search);
if (pos < 0)
{
int pos = text.IndexOf(search);
if (pos < 0)
{
return text;
}
return text.Substring(0, pos) + replace + text.Substring(pos + search.Length);
return text;
}
return text.Substring(0, pos) + replace + text.Substring(pos + search.Length);
}
}