Replace anything between ..

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts
  • el5ateer
    Forum Member
    • Jul 2005
    • 88

    Replace anything between ..

    I was working on a Converter which mainly uses String.Replace .. the problem could be written as a BBcode for example :

    I want to convert

    [font=*******] to (font=*******)
    OR
    [color=******] to (color=*******)

    where the ******* maybe anything and ofcourse i can not put every single word in the language to replace it

    i hope my question is clear

    thanks
    Last edited by el5ateer; 01-21-2007, 04:35 PM.
  • RizlaUK
    Indigo Rose Customer
    • May 2006
    • 5552

    #2
    im not realy sure i get you, if all you want to replace then use

    result = String.Replace(source_string, "[", "(", false);
    result = String.Replace(source_string, "]", ")", false);

    a little more info maybe
    Embrace change in your life, you never know, it could all work out for the best

    Comment

    • el5ateer
      Forum Member
      • Jul 2005
      • 88

      #3
      Thanks for your reply .. Thats what i've thought about .. just replace "[" with "(" and so on .. but if someone wrote something like this :

      Bla bla bla bla bla [e.g. bla bla bla] bla bla

      what shall i do ??!

      thats the problem i face here .. it'll be converted to (e.g. bla bla) which is not needed :s

      Comment

      Working...
      X