Home > front end >  How to format the string in vb?
How to format the string in vb?

Time:12-29

Stated below is a string from which I want to remove the ' and want to pass the formatted string in the PLSQL parameter. Can anyone help me out in this?

The string is:

'BKGSSS220005823','BKGSSS220005824','BKGSSS220005786','BKGSSS220005756','BKGSSS220005858','BKGSSS220005843','BKGSSS220005845','BKGSSS220005862','BKGSSS220005777','BKGSSS220005861','BKGSSS220005867','BKGSSS220005825','BKGSSS220005863','BKGSSS220005859','BKGSSS220005878','BKGSSS220005755','BKGSSS220005877','BKGSSS220005827','BKGSSS220005879','BKGSSS220005852','BKGSSS220005831'

CodePudding user response:

To the replace ' you can do like this, use Strings.Replace

Dim yourString As String = "'BKGSSS220005823','BKGSSS220005824','BKGSSS220005786','BKGSSS220005756','BKGSSS220005858','BKGSSS220005843','BKGSSS220005845','BKGSSS220005862','BKGSSS220005777','BKGSSS220005861','BKGSSS220005867','BKGSSS220005825','BKGSSS220005863','BKGSSS220005859','BKGSSS220005878','BKGSSS220005755','BKGSSS220005877','BKGSSS220005827','BKGSSS220005879','BKGSSS220005852','BKGSSS220005831'"

Dim replacedString As String = yourString.Replace("'", "")

CodePudding user response:

This should do it, don't understand why this was hard.

    Dim someString As String
    someString = "'BKGSSS220005823','BKGSSS220005824','BKGSSS220005786','BKGSSS220005756','BKGSSS220005858','BKGSSS220005843','BKGSSS220005845','BKGSSS220005862','BKGSSS220005777','BKGSSS220005861','BKGSSS220005867','BKGSSS220005825','BKGSSS220005863','BKGSSS220005859','BKGSSS220005878','BKGSSS220005755','BKGSSS220005877','BKGSSS220005827','BKGSSS220005879','BKGSSS220005852','BKGSSS220005831'"
    someString = someString.Replace("','", ",")
  • Related