string

Discussion in 'ASP General' started by amatuer, Dec 13, 2007.

  1. amatuer

    amatuer Guest

    Hi guys, i need some help please. i have a string and i would like to
    run through this string to find a "."(fullstop), and once found put a
    break in so that i could continue the rest of the string on the next
    line.

    can anyone help please?
    thanks a mil
    amatuer, Dec 13, 2007
    #1
    1. Advertising

  2. amatuer

    Evertjan. Guest

    amatuer wrote on 13 dec 2007 in microsoft.public.inetserver.asp.general:

    > Hi guys, i need some help please. i have a string and i would like to
    > run through this string to find a "."(fullstop), and once found put a
    > break in so that i could continue the rest of the string on the next
    > line.


    ASP-jscript:

    s = s.replace(/\./,'.<br>');

    The same with all dots replaced:

    s = s.replace(/\./g,'.<br>');


    --
    Evertjan.
    The Netherlands.
    (Please change the x'es to dots in my emailaddress)
    Evertjan., Dec 13, 2007
    #2
    1. Advertising

  3. amatuer

    Mike Brind Guest

    "amatuer" <> wrote in message
    news:...
    > Hi guys, i need some help please. i have a string and i would like to
    > run through this string to find a "."(fullstop), and once found put a
    > break in so that i could continue the rest of the string on the next
    > line.
    >
    > can anyone help please?
    > thanks a mil


    VBScript:

    s = Replace(s, ".", ".<br>")

    --
    Mike Brind
    Mike Brind, Dec 13, 2007
    #3
  4. amatuer

    amatuer Guest

    On Dec 13, 10:49 am, "Mike Brind" <> wrote:
    > "amatuer" <> wrote in message
    >
    > news:...
    >
    > > Hi guys, i need some help please. i have a string and i would like to
    > > run through this string to find a "."(fullstop), and once found put a
    > > break in so that i could continue the rest of the string on the next
    > > line.

    >
    > > can anyone help please?
    > > thanks a mil

    >
    > VBScript:
    >
    > s = Replace(s, ".", ".<br>")
    >
    > --
    > Mike Brind


    Thanks guys
    amatuer, Dec 13, 2007
    #4
  5. "amatuer" <> wrote in message
    news:...
    > Hi guys, i need some help please. i have a string and i would like to
    > run through this string to find a "."(fullstop), and once found put a
    > break in so that i could continue the rest of the string on the next
    > line.
    >


    sMyText = Replace(sMyText, ".", ".<br />")


    --
    Anthony Jones - MVP ASP/ASP.NET
    Anthony Jones, Dec 13, 2007
    #5
  6. amatuer

    p byers Guest

    Or even

    sMyText = Replace(sMyText, ".", (".<br />" & VbCrLf))

    To avoid long lines and to enhance the readablity of the script

    Pete (Northolt UK)

    Anthony Jones wrote:

    > "amatuer" <> wrote in message
    > news:...
    > > Hi guys, i need some help please. i have a string and i would like to
    > > run through this string to find a "."(fullstop), and once found put a
    > > break in so that i could continue the rest of the string on the next
    > > line.
    > >

    >
    > sMyText = Replace(sMyText, ".", ".<br />")
    >
    > --
    > Anthony Jones - MVP ASP/ASP.NET
    p byers, Dec 14, 2007
    #6
  7. amatuer

    Evertjan. Guest

    p byers wrote on 14 dec 2007 in microsoft.public.inetserver.asp.general:
    > Anthony Jones wrote:
    >> "amatuer" <> wrote in message
    >> news:
    >> ...
    >> > Hi guys, i need some help please. i have a string and i would like
    >> > to run through this string to find a "."(fullstop), and once found
    >> > put a break in so that i could continue the rest of the string on
    >> > the next line.

    >>
    >> sMyText = Replace(sMyText, ".", ".<br />")
    >>

    > Or even
    > sMyText = Replace(sMyText, ".", (".<br />" & VbCrLf))
    > To avoid long lines and to enhance the readablity of the script


    Good plan, but please do not toppost on usenet,
    and do not quote signatures.

    The script is of limited use, because would you want:

    "socks € 5.23.shoes € 29.95."

    to be changed to:

    "socks € 5.
    23.
    shoes € 29.
    95.
    "

    ?

    No, that is where regex will do somewhat(!) better,
    [js example]:

    s = s.replace(/\.([\D]|$)/g,'.<br>$1');

    You can do the same with vbs regex but not in one statement line.

    This would only "fail" for:

    "6 socks € 5.23.2 shoes € 29.95."

    --
    Evertjan.
    The Netherlands.
    (Please change the x'es to dots in my emailaddress)
    Evertjan., Dec 14, 2007
    #7
  8. "p byers" <> wrote in message
    news:...
    > Or even
    >
    > sMyText = Replace(sMyText, ".", (".<br />" & VbCrLf))
    >
    > To avoid long lines and to enhance the readablity of the script
    >



    Readability of what script and why would it need to be readable?

    --
    Anthony Jones - MVP ASP/ASP.NET
    Anthony Jones, Dec 14, 2007
    #8
  9. amatuer

    p byers Guest

    I rather stupidly assumed that the question related to an 'ASPage'
    Also stupidly, maybe that the purpose of an 'ASPage' would be to
    generate some HTML script to be served to the client.

    When I serve such pages, I like to be able to Right Click on the page in
    the Browser and see the source if I have any problems.

    I now have learned my lesson, I will keep my stupid assumptions to
    myself - especially in respect of posts from MVPs

    Sorry
    Pete (Northolt UK)

    Anthony Jones wrote:

    > "p byers" <> wrote in message
    > news:...
    > > Or even
    > >
    > > sMyText = Replace(sMyText, ".", (".<br />" & VbCrLf))
    > >
    > > To avoid long lines and to enhance the readablity of the script
    > >

    >
    > Readability of what script and why would it need to be readable?
    >
    > --
    > Anthony Jones - MVP ASP/ASP.NET
    p byers, Dec 15, 2007
    #9
  10. "p byers" <> wrote in message
    news:...
    > I rather stupidly assumed that the question related to an 'ASPage'
    > Also stupidly, maybe that the purpose of an 'ASPage' would be to
    > generate some HTML script to be served to the client.
    >
    > When I serve such pages, I like to be able to Right Click on the page in
    > the Browser and see the source if I have any problems.
    >
    > I now have learned my lesson, I will keep my stupid assumptions to
    > myself - especially in respect of posts from MVPs
    >



    I apologise, you're quite right view source is a reasonable and useful tool.

    --
    Anthony Jones - MVP ASP/ASP.NET
    Anthony Jones, Dec 15, 2007
    #10
  11. amatuer

    p byers Guest

    Thank you

    Pete (Northolt UK)

    Anthony Jones wrote:

    > "p byers" <> wrote in message
    > news:...
    > > I rather stupidly assumed that the question related to an 'ASPage'
    > > Also stupidly, maybe that the purpose of an 'ASPage' would be to
    > > generate some HTML script to be served to the client.
    > >
    > > When I serve such pages, I like to be able to Right Click on the page in
    > > the Browser and see the source if I have any problems.
    > >
    > > I now have learned my lesson, I will keep my stupid assumptions to
    > > myself - especially in respect of posts from MVPs
    > >

    >
    > I apologise, you're quite right view source is a reasonable and useful tool.
    >
    > --
    > Anthony Jones - MVP ASP/ASP.NET
    p byers, Dec 16, 2007
    #11
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Mladen Adamovic
    Replies:
    0
    Views:
    721
    Mladen Adamovic
    Dec 4, 2003
  2. Mladen Adamovic
    Replies:
    3
    Views:
    14,556
    Mladen Adamovic
    Dec 5, 2003
  3. Matt
    Replies:
    3
    Views:
    477
    Tor Iver Wilhelmsen
    Sep 17, 2004
  4. Bruce Sam
    Replies:
    15
    Views:
    7,862
    John C. Bollinger
    Nov 19, 2004
  5. =?Utf-8?B?UmFqZXNoIHNvbmk=?=

    'System.String[]' from its string representation 'String[] Array'

    =?Utf-8?B?UmFqZXNoIHNvbmk=?=, May 4, 2006, in forum: ASP .Net
    Replies:
    0
    Views:
    1,784
    =?Utf-8?B?UmFqZXNoIHNvbmk=?=
    May 4, 2006
Loading...

Share This Page