Skip to content

Commit 98aeb27

Browse files
author
Josh Fraser
committed
Fix issues joshfraser#1 and joshfraser#2 (thanks Matthew!)
1 parent 0d8fa71 commit 98aeb27

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

‎parse-names.js‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ Array.prototype.implode = function (separator) {
2121
return output;
2222
};
2323
String.prototype.trim = function() {
24-
return this.replace(/^\s+|\s+$/g,"");
24+
return this.replace(/^\s+|\s+$|\,$/g,"");
2525
};
2626
String.prototype.ucfirst = function() {
2727
return this.substr(0,1).toUpperCase() + this.substr(1,this.length - 1).toLowerCase();
@@ -138,7 +138,7 @@ function NameParse() {
138138
// detect and format common suffixes
139139
this.is_suffix = function (word) {
140140
// ignore periods
141-
word = word.replace(".","").toLowerCase();
141+
word = word.replace(/\./g,"").toLowerCase();
142142
// these are some common suffixes - what am I missing?
143143
var suffixArray = ['I','II','III','IV','V','Senior','Junior','Jr','Sr','PhD','APR','RPh','PE','MD','MA','DMD','CME'];
144144
for (var i=0; i<suffixArray.length; i++) {

0 commit comments

Comments
 (0)