tags:

views:

54

answers:

1

Hi!
I am trying to use CamelCase to separate words in order to make title properly.
Some of these strings are also with number. For example: 1962NBAFin4als becomes NBA finals. So it is just ignoring numbers.
I tried to do some research in internet, but I haven't found anything helpful.

Is it a problem of CamelCase??
My java code is:

String fName = Utils.unCamelCase(myString);

Thanks in advance

+1  A: 

You've got some major processing going on there - in that it has to strip out numerics. Then the resulting string it has to determine the words that are left (it has to put a space between NBA and Finals) and then finally it has to know which words to leave all upper case and those to camel case. It's not something you're really going to find in a method - in fact companies provide services like this to clean your data and make a very good living out of it.

Sorry it's bad news, but it's a huge subject. You also have to factor in names that have upper case in the middle (like MacDonalds). You don't split it and the D shouldn't be lower case either.

Paul Hadfield
Thanks for your explanation.
mujer esponja