Activity Forums Salesforce® Discussions What is the Purpose of Contain Method in Salesforce?

  • Deepak

    Member
    August 26, 2019 at 11:40 am

    contains(substring)
    Returns true if and only if the String that called the method contains the specified sequence of characters in substring.

    for example

    String myString1 = 'abcde';
    String myString2 = 'abcd';
    Boolean result =
    myString1.contains(myString2);
    System.assertEquals(result, true);

Log In to reply.

Popular Salesforce Blogs

Popular Salesforce Videos