Design a site like this with WordPress.com
Get started

Function to validate CNIC using Regex

Solution In JQuery var checkCNIC = function (textBox) { debugger; var regexp = new RegExp('^[0-9+]{5}-[0-9+]{7}-[0-9]{1}$'); var check = textBox.value; if (!regexp.test(check)) { alert('Invalid CNIC'); $(textBox).css('border-color', 'red'); return false; } else { $(textBox).css('border-color', 'green'); $(textBox).value = check; return true; } } In HTML @Html.TextBox("AddCNIC", null, new { @class = "form-control text-box", @placeholder = "11111-1111111-1", @onchange =... Continue Reading →

Bitwise and Bitshift Operators in Different Languages

NameLanguagesOperatorExplanationExampleBitwise ANDJava /Python/C/PHP/Javascript /SQL & The & operator compares corresponding bits of two operands. If both bits are 1, it gives 1. If either of the bits is not 1, it gives 0.  a = 55 & 21; Bitwise ORJava /Python/C /PHP/Javascript /SQL | The | operator compares corresponding bits of two operands. If either of the bits is... Continue Reading →

Create a free website or blog at WordPress.com.

Up ↑