Thursday, November 23, 2017

Find "\" Special Character in String with Occurances - JavaScript

Hi All,

Please find the code below to identify Special Character in a String.

var valuewithSpecialCharacter ="yourname\name"
var findSpecialCharacterinDomainName = 0;

    for (i = 0; i <= valuewithSpecialCharacter.length; i++) {
        if (/^[a-zA-Z]+$/.test(valuewithSpecialCharacter[i])) {
            findSpecialCharacterinDomainName += 1;
        } else {
            break;
        }
    }

Note:

You will get Output Count findSpecialCharacterinDomainName.


No comments:

Post a Comment

Dataverse/MSCRM: Work with Masking Rule

  Introduction: In this blog, we will see how to work with Masking Rule in MSCRM or Dataverse. Issue : I don't want to show the Email va...