Advertisement
Dorex

Find all letters in a list

Feb 8th, 2016
271
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.37 KB | None | 0 0
  1. default
  2. {
  3. touch_start(integer total_number)
  4. {
  5. list data = ["A","B","C","D","A"];
  6. integer index;
  7. list positions=[];
  8. string letterToFind = "A";
  9.  
  10. while (index<llGetListLength(data)){
  11. if (llList2String(data,index)==letterToFind){
  12. positions+=index;
  13. }
  14. index++;
  15. }
  16. llOwnerSay("Positions: " + llList2CSV(positions));
  17. }
  18. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement