Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

wcsncmp(3) [linux man page]

WCSNCMP(3)						     Linux Programmer's Manual							WCSNCMP(3)

NAME
wcsncmp - compare two fixed-size wide-character strings SYNOPSIS
#include <wchar.h> int wcsncmp(const wchar_t *s1, const wchar_t *s2, size_t n); DESCRIPTION
The wcsncmp() function is the wide-character equivalent of the strncmp(3) function. It compares the wide-character string pointed to by s1 and the wide-character string pointed to by s2, but at most n wide characters from each string. In each string, the comparison extends only up to the first occurrence of a L'' character, if any. RETURN VALUE
The wcsncmp() function returns zero if the wide-character strings at s1 and s2, truncated to at most length n, are equal. It returns an integer greater than zero if at the first differing position i (i < n), the corresponding wide-character s1[i] is greater than s2[i]. It returns an integer less than zero if at the first differing position i (i < n), the corresponding wide-character s1[i] is less than s2[i]. CONFORMING TO
C99. SEE ALSO
strncmp(3), wcsncasecmp(3) COLOPHON
This page is part of release 3.27 of the Linux man-pages project. A description of the project, and information about reporting bugs, can be found at http://www.kernel.org/doc/man-pages/. GNU
1999-07-25 WCSNCMP(3)

Check Out this Related Man Page

WCSNCMP(3)						     Linux Programmer's Manual							WCSNCMP(3)

NAME
wcsncmp - compare two fixed-size wide-character strings SYNOPSIS
#include <wchar.h> int wcsncmp(const wchar_t *s1, const wchar_t *s2, size_t n); DESCRIPTION
The wcsncmp() function is the wide-character equivalent of the strncmp(3) function. It compares the wide-character string pointed to by s1 and the wide-character string pointed to by s2, but at most n wide characters from each string. In each string, the comparison extends only up to the first occurrence of a null wide character (L''), if any. RETURN VALUE
The wcsncmp() function returns zero if the wide-character strings at s1 and s2, truncated to at most length n, are equal. It returns an integer greater than zero if at the first differing position i (i < n), the corresponding wide-character s1[i] is greater than s2[i]. It returns an integer less than zero if at the first differing position i (i < n), the corresponding wide-character s1[i] is less than s2[i]. ATTRIBUTES
For an explanation of the terms used in this section, see attributes(7). +----------+---------------+---------+ |Interface | Attribute | Value | +----------+---------------+---------+ |wcsncmp() | Thread safety | MT-Safe | +----------+---------------+---------+ CONFORMING TO
POSIX.1-2001, POSIX.1-2008, C99. SEE ALSO
strncmp(3), wcsncasecmp(3) COLOPHON
This page is part of release 4.15 of the Linux man-pages project. A description of the project, information about reporting bugs, and the latest version of this page, can be found at https://www.kernel.org/doc/man-pages/. GNU
2015-08-08 WCSNCMP(3)
Man Page

5 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

reading a string characterwise

hi , I am trying to read two strings character by character using arrays but i couldn't do it pls.give a solution (2 Replies)
Discussion started by: akmtcs
2 Replies

2. Shell Programming and Scripting

Finding character mismatch position in two strings

Hello, I would like to find an efficient way to compare a pair of strings that differ at one position, and return the difference and position. For example: String1 123456789 String2 123454789 returning something - position 6, 6/4 Thanks in advance, Mike (5 Replies)
Discussion started by: etherite
5 Replies

3. Shell Programming and Scripting

reg String comparision

Hi, I would like to compare the 25th position of the file with the character '(' and if it is not equal then it would generate a mail. I have used the below if condition, however it is always executing the code within if, even the comparison is expected to return false. if Please help me... (1 Reply)
Discussion started by: kdheepan
1 Replies

4. UNIX for Dummies Questions & Answers

Getting strings before and after a character

OK This one has me stumped. I have the following line, program name - the program description that can also contain a hyphen - character. I'm need to separate the "program name" from the program description. I've tried using an array function with the - as delimiter, but I ran into a... (2 Replies)
Discussion started by: ricksj
2 Replies

5. UNIX for Dummies Questions & Answers

character-by-character comparison of strings

This might be a dummy question, but is there a command in UNIX that compare two strings character-by-character and display the difference? ---------- Post updated at 11:25 AM ---------- Previous update was at 10:32 AM ---------- Or probably what I'm looking is how to break a string into... (3 Replies)
Discussion started by: Orbix
3 Replies