|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
string split by first occurens numberDoes anyone have a solution for the following problem: I would like to split a string into 2 strings by the first occurense of a number. Example: "Londen street 52" into "Londen street" and "52" "New york harbor 52 dock 2" into "New york harbor" and "dock 2" Does anyone have a solution? Thanx John __________ Informatie van ESET Smart Security, versie van database viruskenmerken 5067 (20100428) __________ Het bericht is gecontroleerd door ESET Smart Security. http://www.eset.com John Devlon wrote:
> Does anyone have a solution for the following problem: Your second example suggests that if there is more text after the number > I would like to split a string into 2 strings by the first occurense > of a number. > > Example: > > "Londen street 52" into "Londen street" and "52" > "New york harbor 52 dock 2" into "New york harbor" and "dock 2" > then the number is to be omitted from the result. Is this correct? -- Andrew Yes, you are right, my mistake.
The second should be: "New york harbor 52 dock 2" into "New york harbor" and "52 dock 2" Sorry Show quoteHide quote "Andrew Morton" <a**@in-press.co.uk.invalid> wrote in message news:83qrabF84dU1@mid.individual.net... > John Devlon wrote: >> Does anyone have a solution for the following problem: >> I would like to split a string into 2 strings by the first occurense >> of a number. >> >> Example: >> >> "Londen street 52" into "Londen street" and "52" >> "New york harbor 52 dock 2" into "New york harbor" and "dock 2" >> > > Your second example suggests that if there is more text after the number > then the number is to be omitted from the result. Is this correct? > > -- > Andrew > Andrew brings up a goo dpoint. Your first example:
> "Londen street 52" into "Londen street" and "52" This implies that "New york harbor 52 dock 2" should beturned into "New york harbor" and "52 dock 2". Saga Show quoteHide quote "John Devlon" <johndevlonNON@SPAMMEhotmail.com> wrote in message news:MqWBn.432$ii2.405@newsfe29.ams2... > Hi, > > Does anyone have a solution for the following problem: > I would like to split a string into 2 strings by the first occurense of a > number. > > Example: > > "Londen street 52" into "Londen street" and "52" > "New york harbor 52 dock 2" into "New york harbor" and "dock 2" > > Does anyone have a solution? > > Thanx > > John > > > > __________ Informatie van ESET Smart Security, versie van database > viruskenmerken 5067 (20100428) __________ > > Het bericht is gecontroleerd door ESET Smart Security. > > http://www.eset.com > > > > On 4/28/2010 9:07 AM, John Devlon wrote:
Show quoteHide quote > Hi, Depending on your answer to the question regarding keeping the 52 in the > > Does anyone have a solution for the following problem: > I would like to split a string into 2 strings by the first occurense of a > number. > > Example: > > "Londen street 52" into "Londen street" and "52" > "New york harbor 52 dock 2" into "New york harbor" and "dock 2" > > Does anyone have a solution? > > Thanx > > John > > > > __________ Informatie van ESET Smart Security, versie van database viruskenmerken 5067 (20100428) __________ > > Het bericht is gecontroleerd door ESET Smart Security. > > http://www.eset.com > > > > first example, then the following regular expression should work. (.*?)(?:\d+)(.*) -- Mike On 4/28/2010 11:11 AM, Family Tree Mike wrote:
Show quoteHide quote > On 4/28/2010 9:07 AM, John Devlon wrote: I see your reply to another post that you want the number in the second >> Hi, >> >> Does anyone have a solution for the following problem: >> I would like to split a string into 2 strings by the first occurense of a >> number. >> >> Example: >> >> "Londen street 52" into "Londen street" and "52" >> "New york harbor 52 dock 2" into "New york harbor" and "dock 2" >> >> Does anyone have a solution? >> >> Thanx >> >> John >> >> >> >> __________ Informatie van ESET Smart Security, versie van database >> viruskenmerken 5067 (20100428) __________ >> >> Het bericht is gecontroleerd door ESET Smart Security. >> >> http://www.eset.com >> >> >> >> > > Depending on your answer to the question regarding keeping the 52 in the > first example, then the following regular expression should work. > > (.*?)(?:\d+)(.*) > string. This means the reqular expression should be: (.*?)(\d+.*) The earlier example did not capture the number portion in the second capture. -- Mike
Re: How to send email with no outlook and SMTP server ?
Is it possible with Linq to update a dataset? Math drawing question Determine depend on services Integrating the webBrowser controlling form Can't evaluate expressionin IDE debug mode Upload/Download files in Chunks on FTP The string font is ugly on chart Do not work well for Windows 7? a few basic question about resource files |
|||||||||||||||||||||||