Questions tagged [string-utils]

50 questions
0
votes
2 answers

Java splitting XML into Separate Strings

I want to split the XML file into separate XML's. By reading the and tags. I have split the XML's using StringUtils.substringsBetween. But, I am able to split only two XML's from the file. The third XML is getting appended with the second.…
JKB
  • 73
  • 2
  • 8
0
votes
1 answer

How to format a string n number of times with a specified character, and then append it to another string?

As the title says, given a string, I would like to pad it (append) with n number of x character. Please see the below code. Is it possible to do that all in one String.format? The commented line shows how to append n number of spaces; I would…
dk40149
  • 99
  • 1
  • 10
0
votes
1 answer

How to manipulate a string in java in below scenario

"\r\n\r\n\r\n\r\nCovered. Coverage is limited to a one-time only 7095 for one outpatien" + "t in vitro fertilization procedure while you are an 7095 member.  If you receive" + " 7095s for in vitro fertilization services under an 7095 plan, you will…
user5982569
0
votes
3 answers

Want to replace WhiteSpace from array of String

private static final String SQL_INSERT = "INSERT INTO ${table}(${keys}) VALUES(${values})"; private static final String SQL_CREATE = "CREATE TABLE ${table}(${keys} VARCHAR(20) NOT NULL)"; private static final String TABLE_REGEX =…
0
votes
2 answers

String Utils join in not working as expected

I have a list of strings which is returned from a query in List A. I am trying to use String Utils.join to combine the values in the list to a string separated by comma and in quotes. But it is not working as expected. Values in abcList - [abc, cde,…
user6591323
  • 69
  • 2
  • 11
0
votes
3 answers

Regular expression to remove unwanted characters from the String

I have a requirement where I need to remove unwanted characters for String in java. For example, Input String is Income ......................4,456 liability........................56,445.99 I want the output as Income 4,456 liability…
athenatechie
  • 699
  • 2
  • 8
  • 15
0
votes
1 answer

Xslt 1.0 check if something exists or empty value?

Hi I am wondering is there any function in XSLT 1.0 and XPath 1.0 to behave like java's Appache StringUtils.isBlank(String str) I use: Edited:
Xelian
  • 16,680
  • 25
  • 99
  • 152
0
votes
2 answers

Building Hibernate query depending of parameters that can be nulls

so i am working on a project right now 1st time using Hibernate in this projet i am using Swing too i have a form with multiple jTextFields public List getoperations(String a,String c,String n,String e,String d) { SessionDao s=new…
Unknwon
  • 7
  • 4
0
votes
1 answer

which is best between string isEmpty and StringUtils.isNotBlank()

I use the following code to check timing: public static void main(String[] args) throws Exception { String foo = "foo"; long start=System.currentTimeMillis(); if (StringUtils.isBlank(foo)); long end=System.currentTimeMillis(); …
kartavya soni
  • 91
  • 1
  • 8
0
votes
2 answers

Substring of a string based on condition

I have a string like below (read from a file and stored in a String)
coder1608
  • 171
  • 6
  • 14
0
votes
3 answers

CountMatches() equivalent Postgres query

We know the stringutils function CountMatches() - CountMatches - counts the number of occurrences of one String in another. I need an equivalent query in postgresql to count the number of occurence of a string in another. Any idea would appreciated…
Sri
  • 1,505
  • 2
  • 18
  • 35
0
votes
2 answers

StringUtils.split() returns an empty string?

Can StringUtils.split function in java return an empty string for input other than an empty string ?
user1484793
  • 359
  • 3
  • 16
0
votes
1 answer

Javadoc for StringUtils

I've added a maven dependency for StringUtils (org.apache.commons.lang) commons-lang 2.6 I want to see javadoc of that jar , otherwise the javadoc for…
Majda
  • 99
  • 1
  • 3
  • 11
0
votes
1 answer

StringUtils.isNotEmpty(str) seems not working properly on hadoop cluster data validation

I am not sure and facing strange nullpointer issue as below. could someone please help me on this in the below code if ((COUNTRY_CODE.equalsIgnoreCase(Country.TEST.name())) && (strCellId.matches("[0-9]*"))) is throwing nullpointer in the log…
Karn_way
  • 1,005
  • 3
  • 19
  • 42
0
votes
1 answer

Make sure I am getting one entry using Randomness

I am trying to generate random columns with the use of below method and after generating columns, I am using those columns in my SELECT sql. final String columnsList = getColumns(table.getColumns()); final String selectSql = "SELECT ID,…
AKIWEB
  • 19,008
  • 67
  • 180
  • 294