Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var decouper = function (texte) {
- var x=0;
- var tableau = [];
- for (var i = 0; i < texte.length; i++) {
- if (condition(texte.charAt(i))) {
- tableau.push(texte.slice(x, i+1));
- x = i+1;
- }
- else {
- continue;
- }
- }
- return tableau;
- };
- var condition = function (caractere){
- var condition = /[^a-zA-Z]/;
- if (caractere.match(condition)) {
- return true;
- } else {
- return false;
- }
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement