mtext_ncasecmp(3m17n)

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

πŸ’… mtext_ncasecmp β€” from the m17n Library πŸŽ€

okay bestie, sit down, we're doing case-insensitive partial string comparison today and honestly? it's giving useful. this is a page from the m17n Library manuals, so you already know it's multilingual-coded. ✨


πŸ“› NAME

mtext_ncasecmp β€” and yeah, that's it, the summary line is literally just the function name and a lonely little dash, no blurb, no teaser, nothing. the manpage authors said "the title is the description" and honestly, respect. 🫢


✨ SYNOPSIS

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

three things go in, one int comes out. iconic behavior. πŸ‘‘


πŸ’– DESCRIPTION

so what does it actually do? it compares the initial parts of two M-texts, and it does it while ignoring cases. uppercase, lowercase, who cares, we're not judging here. πŸ’…

the way that mtext_ncasecmp() works is that it's super similar to mtext_casecmp(), bestie β€” same energy, same vibe β€” except it only compares at most n characters from the beginning. like, it doesn't read the whole thing, it reads the first little bit and then minds its own business. lowkey efficient. 🌸


πŸ”’ RETURN VALUE

the tea on what you get back: this function returns 1, 0, or -1. that's it, that's the whole menu.

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

in that order, respectively, no cap. πŸ“Š


πŸ‘€ SEE ALSO

go read these too, they're all in the same friend group:

  • mtext_cmp()
  • mtext_casecmp()
  • mtext_casecmp() mtext_compare() β€” yes bestie, mtext_casecmp() really does show up twice in the original list, and I am not about to erase her. she's booked and busy. πŸ’€
  • 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>.


πŸŽ€ legal besties, the license link is right there, please actually read it before you redistribute this page, I'm begging πŸ™ˆ

and that's the whole page, babes. Version 1.8.4, dated Mon Sep 25 2023, and yeah, that footer has been sitting there since 2023 being all mysterious. go forth and compare your M-texts case-insensitively, you absolute main character. πŸ’–βœ¨πŸ¦‹

πŸ“¦ where this page comes from