- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
How to check if a string is a subset of another string in R?
To check whether a string is a subset of another string we can use grepl function.
Example
> Company <- "TutorialsPoint" > Job <- "Tutor" > grepl(Job, Company, fixed = TRUE) [1] TRUE
Here we are getting TRUE because Tutor is a subset of TutorialsPoint.
> grepl(Company, Job, fixed = TRUE) [1] FALSE
Here we are getting FALSE because TutorialsPoint is not a subset of Tutor.
- Related Articles
- How to check if a set is a subset of another set in R?
- Check if a string is suffix of another in Python
- Check If a String Can Break Another String in C++
- How to check if a substring is contained in another string in Python
- How to check if a String contains another String in a case insensitive manner in Java?
- Check if string contains another string in Swift
- Check if a string can be repeated to make another string in Python
- Java Program to Check if a set is the subset of another set
- How to check if a string contains only one type of character in R?
- How to check if a string contains a specific sub string?
- How to replace total string if partial string matches with another string in R data frame column?
- How to check if a string is alphanumeric in Python?
- How to check if a string is empty in Kotlin?
- Check if a string can be formed from another string using given constraints in Python
- Check if a string can be obtained by rotating another string 2 places in Python

Advertisements