Learn R Programming

matlab2r (version 1.5.0)

strcmp: Compare two character elements

Description

Logical test if two character elements are identical

Usage

strcmp(s1, s2)

Value

a logical element of the same type as the input

Arguments

s1

first character element (string, vector or matrix)

s2

second character element (string, vector or matrix)

Examples

Run this code
strcmp("yes", "no")
strcmp("yes", "yes")
strcmp("no", "no")

Run the code above in your browser using DataLab