Advertisement
tyridge77

Untitled

Jul 22nd, 2015
176
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.64 KB | None | 0 0
  1.  static String[] GetStringsBetween(String initialstring,char start,char end)
  2.          {
  3.           String[] Sets = new String[10000];
  4.           int newstart = 0;
  5.           int SetsFound = 0;
  6.           int newend = 0;
  7.  
  8.           for(int i = 0;i<initialstring.length();i++)
  9.           {
  10.            char character = initialstring.charAt(i);
  11.            if(character==start)
  12.            {
  13.             newstart = i+1;
  14.            }
  15.            if(character == end)
  16.            {
  17.             newend = i;
  18.             Sets[SetsFound] = initialstring.substring(newstart, newend);
  19.             SetsFound++;
  20.            }
  21.           }
  22.           return Sets;
  23.          }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement