Case-Insensitive String Comparison in SuiteScript.

Scenario: To compare two strings without considering their case sensitivity in SuiteScript, you can convert both strings to lowercase (or uppercase) before comparing them.

var fundNameFromPortal = "abc";
var fundNumberReceivedDetails = "ABC";

// Convert both strings to lowercase before comparing
var fundNameLower = fundNameFromPortal.toLowerCase();
var fundNumberLower = fundNumberReceivedDetails.toLowerCase();

// Compare the lowercase versions of the strings
if (fundNameLower !== fundNumberLower) {
    log.debug('Do the process');
}

Leave a comment

Your email address will not be published. Required fields are marked *