#1
  1. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2000
    Posts
    139
    Rep Power
    15
    There's a few questions I have and I have a feeling they all require similar things/functions, so here we go...

    1) If you have a multiple-line string, how do you find every occurrance of, in this case, http:// or www.<something>.<something> or <something>@<something>.<something> and then replace it with <a href="<that string>"> ? Basically find all occurances of something in a string and replace it/them with something else

    2) If you have a multiple-line string, how do you take each line of that string and prefix it with a character, like > or - ?

    3) In a string, how do you find if it starts with a symbol, like [ or < or { etc.

    TIA.
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Sep 2000
    Location
    Herne Bay, Kent, UK
    Posts
    30
    Rep Power
    15
    I'm not sure about the first one, but you'd probably need to use Regular Expressions. For number 2) Search for "n" and replace it with "n>" or something like that (you *may* need to search for something different if your client is on a windows machine). For number 3) use something like this:
    if (substr($myString,0,1)=="[") { //dosomething }

Similar Threads

  1. couple of newb questions about input
    By lummy64 in forum C Programming
    Replies: 3
    Last Post: January 24th, 2004, 11:45 PM
  2. a Couple of questions!
    By Nik in forum Linux Help
    Replies: 0
    Last Post: January 21st, 2004, 12:32 PM
  3. A few Install questions
    By kolatracks in forum Linux Help
    Replies: 2
    Last Post: October 27th, 2003, 03:31 AM
  4. Converting numbered strings into int
    By C_rookie in forum C Programming
    Replies: 12
    Last Post: October 6th, 2003, 04:23 PM
  5. a Couple of questions!
    By Nik in forum Perl Programming
    Replies: 10
    Last Post: September 20th, 2003, 02:19 PM

IMN logo majestic logo threadwatch logo seochat tools logo