Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7631415
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T06:20:53+00:00 2026-05-31T06:20:53+00:00

matches : Will check if the complete string entered is equal to the value

  • 0

matches: Will check if the complete string entered is equal to the value present in the string object.

equalsIgnoreCase: Ignoring the case, it checks if the string entered is equal to the value present in the string object.

equals: Case sensitive and it checks if the string entered is equal to the value present in the string object.

This is what I know about the methods, present in String class.

Are there any other differences(Am I missing any valuable differences)?

If there are no differences, then why cant matches method be removed from String class, since the functionality it puts forth can be achieved using the other above mentioned methods, appropriately.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T06:20:54+00:00Added an answer on May 31, 2026 at 6:20 am

    There is a big difference – matches checks the match of a String to a regular expression pattern, not the same string. Do not be mislead by the fact that it receives a String as an argument.

    For example:

    "hello".equals(".*e.*"); // false
    "hello".matches(".*e.*"); // true
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to complete a regular expression that will pull out matches based on
Often I want to check if a provided value matches one in a list
I want to check if a certain pattern (eg. a double quoted string) matches
I would like to perform a MySQL regular expression which will check a string
I am looking for a regular expression that will test for matches against a
I am using the matches string builtin and need to run a regex pattern
In php is there a way i can check if a string includes a
I need help with a regex to check if a line matches a line
My application will basically accept user input via the main(String[] args) method. I have
I want to check if my list of objects contain an object with a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.