Advertisement
atelbor

[GRVY] Strings

Oct 7th, 2022 (edited)
2,333
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. /*************************/
  2. /*   GROOVY - Strings    */
  3. /*************************/
  4.  
  5. // Comparar cadena de texto con expresión regular
  6. // Extraer subcadena de un texto
  7. // Comprobaciones
  8.  
  9. /************************************************************************/
  10.  
  11. // Comparar cadena de texto con expresión regular
  12. import java.util.regex.Matcher
  13. import java.util.regex.Pattern
  14. .....
  15. Pattern pattern = Pattern.compile("[^N]OK|^OK");
  16. Matcher match = pattern.matcher(requirementStatusValue.toString());
  17. if (match.find()) { ..... }
  18. /************************************/
  19.  
  20. // Extraer subcadena de un texto
  21. if(issue.description?.length() > 3000){    // Comprobación necesaria para evitar excepción (IndexOutOfBounds)
  22.     params.put("description",issue.description.substring(0, 3000));
  23. }else{
  24.     params.put("description",issue.description);
  25. }
  26. /************************************/
  27.  
  28. // Comprobaciones
  29. Objects.isNull(regTestCycleValue)
  30. Objects.nonNull(regTestCycleValue)
  31. StringUtils.isBlank(regTestCycleValue)
  32. /************************************/
  33.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement