From fb799cd53ee28b003f611e7059aaed5b65d17c4b Mon Sep 17 00:00:00 2001 From: Hassan Date: Wed, 25 Jan 2017 10:50:12 +0300 Subject: [PATCH 1/3] Added removeTatwel() function --- README.md | 14 ++++++++++++-- arabicString.js | 17 +++++++++++++++++ 2 files changed, 29 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 94b3309..b2b208c 100644 --- a/README.md +++ b/README.md @@ -81,7 +81,18 @@ Will return the `String` without the diacritics. //=> 'وترى الكواكب في المجرة شرعا *** مثل الظباء كوارعا في جدول' ``` -## License +##String#removeTatwel() + +Will return the `String` without the diacritics. + +### Example + +```js +'مــرــحــبــا'.removeTatwel() +//=> 'مرحبا' +``` + +## License (The MIT License) @@ -92,4 +103,3 @@ Permission is hereby granted, free of charge, to any person obtaining a copy of The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - diff --git a/arabicString.js b/arabicString.js index 6495e96..6c70a93 100755 --- a/arabicString.js +++ b/arabicString.js @@ -160,3 +160,20 @@ String.prototype.removeArabic = function () { return this.replace(/[\u0621-\u0652]/gm, ''); } + +/** + * Remove Tatwel letters + * + * Example + * + * 'مــرــحــبــا'.removeTatwel() + * //=> 'مرحبا' + * + * + * + * @returns {String} + */ + +String.prototype.removeTatwel = function() { + return this.replace(/\u0640/g, ''); +} \ No newline at end of file From b925bfdbefdaa807c2350c033aaeffb8cab284cd Mon Sep 17 00:00:00 2001 From: Hassan Algoz Date: Wed, 25 Jan 2017 10:51:11 +0300 Subject: [PATCH 2/3] Update arabicString.js --- arabicString.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arabicString.js b/arabicString.js index 6c70a93..45a0d12 100755 --- a/arabicString.js +++ b/arabicString.js @@ -166,7 +166,7 @@ String.prototype.removeArabic = function () { * * Example * - * 'مــرــحــبــا'.removeTatwel() + * 'مــرحــبــا'.removeTatwel() * //=> 'مرحبا' * * @@ -176,4 +176,4 @@ String.prototype.removeArabic = function () { String.prototype.removeTatwel = function() { return this.replace(/\u0640/g, ''); -} \ No newline at end of file +} From ab570f4745ff492b9550fa0579a0344454579d82 Mon Sep 17 00:00:00 2001 From: Hassan Algoz Date: Wed, 25 Jan 2017 10:52:32 +0300 Subject: [PATCH 3/3] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index b2b208c..d31f0be 100644 --- a/README.md +++ b/README.md @@ -88,7 +88,7 @@ Will return the `String` without the diacritics. ### Example ```js -'مــرــحــبــا'.removeTatwel() +'مــرحــبــا'.removeTatwel() //=> 'مرحبا' ```