mtext_ncmp(3m17n)

πŸ“¦
version 1.8.4 Β· 2 versions
, in debian trixie, ubuntu noble, ubuntu questing, ubuntu resolute, ubuntu stonking

πŸ’– NAME πŸ’–

mtext_ncmp β€” like, the name says it all bestie, no cap


✨ SYNOPSIS ✨

int mtext_ncmp (MText * mt1, MText * mt2, int n)

🌸 DESCRIPTION 🌸

Okay so picture this: you've got two M-texts and you wanna compare their initial parts, character-by-character, like you're lining up two besties side by side and checking who's taller. That's literally what mtext_ncmp() does. 🫢

It's basically mtext_cmp()'s sister β€” same energy, same vibe β€” except she stops early. Instead of comparing the whole thing, she compares at most n characters from the beginning. Periodt. That's the whole deal. πŸ’…


πŸ‘‘ RETURN VALUE πŸ‘‘

She hands you back one of three little numbers, and they mean exactly this:

  • 1 β€” mt1 is greater than mt2
  • 0 β€” mt1 is equal to mt2
  • -1 β€” mt1 is less than mt2

So it's 1, 0, or -1 depending on whether mt1 is found greater than, equal to, or less than mt2. Simple. Iconic. No notes. 🌟


πŸ¦‹ SEE ALSO πŸ¦‹

The whole friend group, go say hi:

  • mtext_cmp()
  • mtext_casecmp()
  • mtext_ncasecmp()
  • mtext_compare()
  • mtext_case_compare()

Copyright (C) 2001 Information-technology Promotion Agency (IPA)

Copyright (C) 2001-2011 National Institute of Advanced Industrial Science and Technology (AIST)

Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License <http://www.gnu.org/licenses/fdl.html>.


and that's the whole page, bestie β€” this was m17n Library, mtext_ncmp(3m17n), Version 1.8.4, dated Mon Sep 25 2023. stan a tiny n that saves you a whole comparison. mwah πŸ’‹βœ¨

πŸ“¦ where this page comes from