Advertisement
fbinnzhivko

Untitled

Oct 1st, 2016
130
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function az(input) {
  2.     let test_str = String(input);
  3.  
  4.     let print_String = [];
  5.     for (let i = 0; i < 115; i++) {
  6.         let start_position = test_str.indexOf('(');
  7.         let end_position = test_str.indexOf(')', start_position);
  8.         var text_to_get = test_str.substr(start_position + 1, end_position - start_position - 1);
  9.         let removed_String = test_str.substr(0, end_position + 1);
  10.         test_str = test_str.replace(removed_String, '');
  11.  
  12.         print_String.push(text_to_get);
  13.     }
  14.  
  15.     let x = print_String.filter(function (e) {
  16.         return e
  17.     }).toString();
  18.  
  19.     console.log(x);
  20.  
  21.  
  22. }
  23. az(['Rakiya (Bulgarian brandy) is self-made liquor (alcoholic drink)']);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement