daily pastebin goal
10%
SHARE
TWEET

AR Script: Search for substring, add prefix if found

a guest Mar 25th, 2017 64 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. var search_and_add = [["_108_", "Agent1_"], ["_223_", "Agent2_"], ["_600", "Agent3_"]];
  2.  
  3. for (idx = 0; idx < search_and_add.length; idx++){
  4.   if (item.newBasename.search(search_and_add[idx][0]) != -1){
  5.     return search_and_add[idx][1] + item.newBasename;
  6.   }
  7. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top