Skip to content

Commit dfe0a24

Browse files
committed
Fixed str_word_count#3
1 parent bbd410f commit dfe0a24

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

functions/strings/str_word_count.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@ function str_word_count (str, format, charlist) {
1212
// * example 2: str_word_count("Hello fri3nd, you're\r\n looking good today!", 2);
1313
// * returns 2: {0: 'Hello', 6: 'fri', 10: 'nd', 14: "you're", 29: 'looking', 46: 'good', 51: 'today'}
1414
// * example 3: str_word_count("Hello fri3nd, you're\r\n looking good today!", 1, '\u00e0\u00e1\u00e3\u00e73');
15-
// * returns 3: ['Hello', 'fri3nd', 'youre', 'looking', 'good', 'today']
15+
// * returns 3: ['Hello', 'fri3nd', "you're", 'looking', 'good', 'today']
16+
1617
var len = str.length,
1718
cl = charlist && charlist.length,
1819
chr = '',
@@ -98,5 +99,6 @@ function str_word_count (str, format, charlist) {
9899
} else if (format === 2) {
99100
return assoc;
100101
}
102+
101103
throw 'You have supplied an incorrect format';
102104
}

0 commit comments

Comments
 (0)