Linked Questions

-1 votes
2 answers
1k views

I know how to split a string by space as the following: String[] array = string.split(" "); This works great until I try to split string that starts with a space like " I like apple" The result ...
Terence Lyu's user avatar
-2 votes
4 answers
398 views

I am currently trying to brush up on Java for university using codebat. My goal is to take a string of any ASCII characters, split all of the numbers from the string, then return the sum of all of the ...
bulldogs586's user avatar
1 vote
6 answers
345 views

I have used Split method on a String that contains + - and | and i dont wanna get that empty value, here's my code public class Test { public static void main(String args[]) { String ab="+...
Fragan's user avatar
  • 892
0 votes
0 answers
36 views

I want to split a string by WHITE_SPACE, LPAREN or RPAREN. I've tried this: String st = "( a * b - (c * d )"; String[] subs = split.("(\\s+|\\(|\\))"); This kind of works, but it gives me empty ...
One Two Three's user avatar
5 votes
4 answers
6k views

I need to be able to split an input String by commas, semi-colons or white-space (or a mix of the three). I would also like to treat multiple consecutive delimiters in the input as a single delimiter. ...
AndreiM's user avatar
  • 4,598
2 votes
11 answers
5k views

I was attempting the Time Conversion challenge on Hackerrank, but for some reason, the hour field in the 24-hour representation always comes out empty. Here's the challenge - Problem Statement ...
Dust_In_The_Wind's user avatar
3 votes
2 answers
1k views

I am trying to split a string according to a certain set of delimiters. My delimiters are: ,"():;.!? single spaces or multiple spaces. This is the code i'm currently using, String[] arrayOfWords= ...
Juliana's user avatar
  • 47
0 votes
4 answers
3k views

I'm trying to get the digits from the expression [1..1], using Java's split method. I'm using the regex expression ^\\[|\\.{2}|\\]$ inside split. But the split method returning me String array with ...
Dusk's user avatar
  • 2,201
0 votes
3 answers
882 views

I'm parsing an input file that has multiple keywords preceded by a +. The + is my delimiter in a split, with individual tokens being written to an array. The resulting array includes a blank record in ...
dwwilson66's user avatar
  • 7,114
-1 votes
2 answers
870 views

I have a string like this in Java: "\xd0\xb5\xd0\xbd\xd0\xb4\xd0\xbf\xd0\xbe\xd0\xb9\xd0\xbd\xd1\x82" How can I convert it to a human readable equivalent? Note: actually it is GWT and this string is ...
ILAPE's user avatar
  • 77