Hi, I'm having an issue with some string splitting. I have an address "Stewn St 1278 Ste 20". I want to split it on "Ste", or suite, so that I can get the numbers after. However, I DON'T want the 'Ste' from Stewn to be included, as i'll receive "wn" or "st". I only want to split on the phrase 'Ste' alone. Can anyone help me with this? Thanks.
wouldn't it be more wise just to format the string to some defined standard, one space, for example. And then divide it into string blocks and search for the "Ste" block. Finding it would mean that the next one would be the number. And so on.
to trim a string, make it one-spaced and then split into string blocks:
Wanna install linux on a vacuum cleaner. Could anyone tell me which distro sucks better?
I had a nightmare last night. I was dreaming that I’m 64-bit and my blanket is 32-bit and I couldn’t cover myself with it, so I’ve spent the whole night freezing. And in the morning I find that my blanket just had fallen off the bed. =S(from: bash.org.ru)
//always looking for job opportunities in AU/NZ/US/CA/Europe :P
willCodeForFood(Arrays.asList("Java","PHP","C++","bash","Assembler","XML","XHTML","CSS","JS","PL/SQL"); USE [code] TAGS!Read this FAQ if you are new here. If this post was helpful, please rate it!
Theoretically interesting but not practical. Normally when parsing strings one won't extract only one piece of data.
Wanna install linux on a vacuum cleaner. Could anyone tell me which distro sucks better?
I had a nightmare last night. I was dreaming that I’m 64-bit and my blanket is 32-bit and I couldn’t cover myself with it, so I’ve spent the whole night freezing. And in the morning I find that my blanket just had fallen off the bed. =S(from: bash.org.ru)
//always looking for job opportunities in AU/NZ/US/CA/Europe :P
willCodeForFood(Arrays.asList("Java","PHP","C++","bash","Assembler","XML","XHTML","CSS","JS","PL/SQL"); USE [code] TAGS!Read this FAQ if you are new here. If this post was helpful, please rate it!
Theoretically interesting but not practical. Normally when parsing strings one won't extract only one piece of data.
yep, but this is the answer to the question in the OP:
Originally Posted by roger8989tt
I want to split it on "Ste", or suite, so that I can get the numbers after. However, I DON'T want the 'Ste' from Stewn to be included, as i'll receive "wn" or "st". I only want to split on the phrase 'Ste' alone. Can anyone help me with this?
Bookmarks