Advertisement
Jym_Nova

Store words wrapped in quotes

Dec 9th, 2016
414
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // Written By: Ĵyм Ѡҩℓƒ (Jym Resident)
  2. /*
  3. LICENCE:
  4. This program is free software: you can redistribute it and/or modify
  5. it under the terms of the GNU General Public License as published by
  6. the Free Software Foundation, either version 3 of the License, or
  7. any later version.
  8.  
  9. This program is distributed in the hope that it will be useful,
  10. but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  12. GNU General Public License for more details.
  13.  
  14. You should have received a copy of the GNU General Public License
  15. along with this program.  If not, see <http://www.gnu.org/licenses/>.
  16. or you may visit - http://license.idjhost.com/
  17. */
  18. // DESCRIPTION
  19. // Test script to verify you can use quotes in the different say variations
  20.  
  21. string test = "This is a \"test\" to see how \"many\" quotes are \"contained\"";
  22. string newString;
  23. integer length;
  24. integer start;
  25. integer end;
  26. list makeList = [];
  27.  
  28. default {
  29.     state_entry() {
  30.         do {
  31.             length = llStringLength(test);
  32.             start = llSubStringIndex(test,"\"");
  33.             test = llDeleteSubString(test,0,start);
  34.             end = llSubStringIndex(test,"\"");
  35.             newString = llGetSubString(test,0,end-1);
  36.             test = llDeleteSubString(test,0,end);
  37.             if(newString != "") {
  38.                 // Uncomment below for debug
  39.                 //llOwnerSay("In Quotes: "+newString);
  40.                 makeList += newString;
  41.             }
  42.         } while (start != -1);
  43.         llOwnerSay("Words wrapped in quotes: "+llList2CSV(makeList));
  44.     }
  45. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement