groovy-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From adithyank <adi.k....@gmail.com>
Subject More Default String Methods
Date Fri, 12 Oct 2018 19:22:22 GMT
As suggested by Jochen Theodorou in this 
link
<http://groovy.329449.n5.nabble.com/New-DSLs-in-the-groovy-platform-itself-for-more-script-like-use-cases-td5750522.html>
 
post, I have created this topic for `More Default String Methods` 

I would like to work in these if the community accepts this proposal

//Method to return left n characters
*1. static String left(String self, int chars)*

//Method to return right n characters
*2. static String right(String self, int chars)*

//Method to return the String that is after the first occurrence of the
given searchString
*3. static String after(String self, String searchString)*

//Method to return the String that is before the first occurrence of the
given searchString
*4. static String before(String self, String searchString)*

//Method to return the String that is before the first '=' character
*5. static String getBeforeEq(String self)*


/**
Splits the given String with the given separator String and returns the
value at the given column Index. By
default, successive occurrence of the separator String is taken are one unit
and the split is performed
*/
*6. static String column(String self, String separator, int colIndex)*


/**
Splits the given String with Space characters and returns the value at the
given column Index.
*/
*7. static String column(String self, int colIndex)*

//Method to return the String that is between the pair of double quotes
*8. static String bwDoubleQuotes(String line)*

//Method to return the String that is between the pair of single quotes
*9. static String bwSingleQuotes(String line)*

//Method to return the String that is between the pair of given enclosure
String
*10. static String bw(String line, String enclosure)*

//Method to return the String that is between the 2 given strings
*11. static String bw(String line, String from, String to)*


//Method to return the String that is between the nth pair of double quotes
*12. static String bwDoubleQuotes(String line, int index)*


//Method to return the String that is between the nth pair of single quotes
*13. static String bwSingleQuotes(String line, int index)*


//Method to return the String that is between the nth pair of given
enclosure String
*14. static String bw(String line, String enclosure, int index)*

//Method to check whether searchString exists within self String ignoring
the case
*15. static boolean containsIgnoreCase(String self, String searchString)*

//Method to check whether the String starts with the searchString ignoring
the case
*16. static boolean startsWithIgnoreCase(String self, String searchString)*

//Method to check whether the String ends with the searchString ignoring the
case
*17. static boolean endsWithIgnoreCase(String self, String searchString)*






--
Sent from: http://groovy.329449.n5.nabble.com/Groovy-Dev-f372993.html

Mime
View raw message