Advertisement
Guest User

Untitled

a guest
Nov 20th, 2019
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.50 KB | None | 0 0
  1. function removeFromArrayIfFound(needle, stringArray){
  2.     int matchCount = 0;
  3.     string[] cleanedStringArray = new String[stringArray.length];
  4.     for(int i=0; i<stringArray.length; i++){
  5.         if( !regexCheck(needle, stringArray[i]) ){
  6.             cleanedStringArray[matchCount] = stringArray[i];
  7.             matchCount++;
  8.         }
  9.     }
  10.     return cleanedStringArray;
  11. }
  12.  
  13. function checkString(needle, haystack){
  14.     Pattern pattern = Pattern.compile(needle);
  15.     Matcher matcher = pattern.matcher(haystack);
  16.     return matcher.matches();
  17. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement