Skip to content

Commit

Permalink
Create Check_for_palindrome.md
Browse files Browse the repository at this point in the history
  • Loading branch information
meetzaveri authored Dec 12, 2017
1 parent 31f2d06 commit d76c550
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions snippets/Check_for_palindrome.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
### Check For Palindrome

```
function palindrome(str) {
var rg =/[\W_]/g;
var low_rep=str.toLowerCase().replace(rg,'');
var final= low_rep.split('').reverse().join('');
return final == low_rep;
}
```

0 comments on commit d76c550

Please sign in to comment.