https://learn.microsoft.com/en-us/dotnet/api/system.memoryextensions.lastindexofanyexcept?view=net-10.0&viewFallbackFrom=netcore-2.2
MemoryExtensions.LastIndexOfAnyExcept Method (System) | Microsoft Learn
Searches for the last index of any value other than the specified value0 or value1.
methodsystemmicrosoftlearn