C# equivalent strnicmp function in C language. It accepts two input strings along with the number of positions of chars to compare.
C# equivalent strnicmp function in C language. It accepts two input strings along with the number of positions of chars to compare.
Join the conversation! Your thoughts help the community grow.
Join to leave a comment
Members earn 10 SHARP for a comment, 10 SHARP for a reaction, and 1,000 SHARP for every article they publish.
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegisterMembers onlyFeatured eBookClaude for AI-Native BuildersDownload nowWrite an article and earn +1,000 SHARP when it is approved.
Write an article
DaveeditedPosted Feb 27, 2009, 9:15 AM ESTEdited Feb 27, 2009, 9:17 AM EST
public int strnicmp(string s1, string s2, int n) { // param validation omitted for clarity return String.Compare(s1.Substring(0, n), s2.Substring(0, n), true); }