mirror of
https://github.com/bitwarden/server.git
synced 2025-06-03 17:50:32 -05:00

* Upgrade to .NET 8 * Linting * Clean up old JSON deserialization code * More .NET 8-oriented linting * Light feedback * Get rid of old test we don't know the root issue for * Fix a new test * Remove now-unnecessary Renovate constraint * Use Any() * Somehow a 6.0 tooling config we don't need snuck back in * Space out properties that always change per release * Bump a few core packages since the last update
22 lines
513 B
C#
22 lines
513 B
C#
namespace Bit.Core.Utilities;
|
|
|
|
public static class SpanExtensions
|
|
{
|
|
public static bool TrySplitBy(this ReadOnlySpan<char> input,
|
|
char splitChar, out ReadOnlySpan<char> chunk, out ReadOnlySpan<char> rest)
|
|
{
|
|
var splitIndex = input.IndexOf(splitChar);
|
|
|
|
if (splitIndex == -1)
|
|
{
|
|
chunk = default;
|
|
rest = input;
|
|
return false;
|
|
}
|
|
|
|
chunk = input[..splitIndex];
|
|
rest = input[++splitIndex..];
|
|
return true;
|
|
}
|
|
}
|