locked
Remove last OR in a string RRS feed

  • General discussion

  • hi all,

    I am trying to remove the last "or" in below statement. How would I do that?

    str = " select acc from tbl1 where uid_a ='asd' or uid_a ='adfdsd' or or uid_a ='adfdsd' or "


    VHO

    Thursday, December 20, 2012 1:50 PM

All replies

  • str = str.Substring(0, str.LastIndexOf("or"));
     
    Thursday, December 20, 2012 2:05 PM