Activity › Forums › Salesforce® Discussions › What is the Purpose of Contain Method in Salesforce? Tagged: Contain Method, String Salesforce® Discussions What is the Purpose of Contain Method in Salesforce? Posted by Achintya on August 26, 2019 at 11:36 AM What is the Purpose of Contain Method in salesforce? Deepak replied 6 years, 9 months ago 2 Members · 1 Reply Contain MethodString 1 Reply 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. Public All Members My Connections Only Me PublicAll MembersMy ConnectionsOnly Me Public All Members My Connections Only Me