Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- system::strCheck:
- Check if the strings ('s_' and '_s') match each other.
- Arguments:
- s_[] First string.
- _s[] Second string.
- (op) bool:ic ignorecase. (default: true)
- Returns:
- ? False, True.
- Notes:
- Similar to strcmp, but faster.
- ignorecase -> When set to true, the case doesn't matter - HeLLo is the same as Hello. When false, they're not the same.
- */
- stock
- system::strCheck(s_[], _s[], bool:ic = true)
- {
- new
- c = 0
- , bool:b = true
- ;
- while (max(strlen(s_), strlen(_s)) != c)
- {
- if(ic)
- {
- _s[c] = (
- s_[c] >= 0b1100001 && s_[c] <= 0b1111010 ||
- _s[c] >= 0b1100001 && _s[c] <= 0b1111010 ||
- s_[c] >= 0b1000001 && s_[c] <= 0b1011010 ||
- _s[c] >= 0b1000001 && _s[c] <= 0b1011010
- )
- ? (s_[c]) : _s[c]
- ;
- }
- if (s_[c] != _s[c])
- {
- b
- = false
- ;
- }
- ++
- c
- ;
- }
- if (b)
- {
- return true;
- }
- else
- {
- return false;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement