[+] AuEndsWith char variant

[+] AuStartsWith char variant
This commit is contained in:
Reece Wilson 2024-09-27 18:17:53 +01:00
parent 0965d38675
commit c2d29861e3

View File

@ -52,6 +52,18 @@ static auline AU_CONSTEXPR_17 bool AuEndsWith(AuROString const &value, AuROStrin
} }
} }
static auline AU_CONSTEXPR_17 bool AuEndsWith(AuROString const &value, const char &ending)
{
if (value.empty())
{
return false;
}
else
{
return value[value.size() - 1] == ending;
}
}
static auline AU_CONSTEXPR_17 bool AuStartsWith(AuROString const &value, AuROString const &starting) static auline AU_CONSTEXPR_17 bool AuStartsWith(AuROString const &value, AuROString const &starting)
{ {
#if defined(AU_STRING_IS_TINYUTF_EXPERIMENT) #if defined(AU_STRING_IS_TINYUTF_EXPERIMENT)
@ -63,6 +75,18 @@ static auline AU_CONSTEXPR_17 bool AuStartsWith(AuROString const &value, AuROStr
#endif #endif
} }
static auline AU_CONSTEXPR_17 bool AuStartsWith(AuROString const &value, const char &starting)
{
if (value.empty())
{
return false;
}
else
{
return value[0] == starting;
}
}
/// Alias for AuCodepointsToLower /// Alias for AuCodepointsToLower
static AuString AuToLower(const AuROString &in) static AuString AuToLower(const AuROString &in)
{ {