String manipulation

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Lee

    String manipulation

    Hi All,

    I need to make a string look like this. I am calling a program and need to
    send args to it.

    "c:\program files\program dir\prog.exe" /B "c:\config files\file1.txt "

    The quotes need to be passed exactly as they are in that string or it will
    not work. I need the quotes or I end up getting things trucated.

    Thanks

    Lee


  • Jared Parsons [MSFT]

    #2
    Re: String manipulation

    Try

    @"""c:\progr am files\program dir\prog.exe"" /B ""c:\config
    files\file1.txt """
    --
    Jared Parsons [MSFT]
    jaredpar@online .microsoft.com

    "This posting is provided "AS IS" with no warranties, and confers no rights"
    "Lee" <latrotter@spam less.sympatico. ca> wrote in message
    news:eWfG8dMUFH A.2124@TK2MSFTN GP14.phx.gbl...[color=blue]
    > Hi All,
    >
    > I need to make a string look like this. I am calling a program and need
    > to send args to it.
    >
    > "c:\program files\program dir\prog.exe" /B "c:\config files\file1.txt "
    >
    > The quotes need to be passed exactly as they are in that string or it will
    > not work. I need the quotes or I end up getting things trucated.
    >
    > Thanks
    >
    > Lee
    >[/color]


    Comment

    • Lee

      #3
      Re: String manipulation

      This is what I get that that:

      "\"C:\\prog ram files\\program dir\\prog.exe\" /B \"C:\\config
      files\\files1.t xt\""

      That is right out of the watch window

      "Jared Parsons [MSFT]" <jaredpar@onlin e.microsoft.com > wrote in message
      news:Olkq0iMUFH A.752@TK2MSFTNG P10.phx.gbl...[color=blue]
      > Try
      >
      > @"""c:\progr am files\program dir\prog.exe"" /B ""c:\config
      > files\file1.txt """
      > --
      > Jared Parsons [MSFT]
      > jaredpar@online .microsoft.com
      > http://blogs.msdn.com/jaredpar
      > "This posting is provided "AS IS" with no warranties, and confers no
      > rights"
      > "Lee" <latrotter@spam less.sympatico. ca> wrote in message
      > news:eWfG8dMUFH A.2124@TK2MSFTN GP14.phx.gbl...[color=green]
      >> Hi All,
      >>
      >> I need to make a string look like this. I am calling a program and need
      >> to send args to it.
      >>
      >> "c:\program files\program dir\prog.exe" /B "c:\config files\file1.txt "
      >>
      >> The quotes need to be passed exactly as they are in that string or it
      >> will not work. I need the quotes or I end up getting things trucated.
      >>
      >> Thanks
      >>
      >> Lee
      >>[/color]
      >
      >[/color]


      Comment

      • Jared Parsons [MSFT]

        #4
        Re: String manipulation

        That's still the program representation. If you print that string out, say
        to the console, it should be as you specified

        --
        Jared Parsons [MSFT]
        jaredpar@online .microsoft.com

        "This posting is provided "AS IS" with no warranties, and confers no rights"
        "Lee" <latrotter@spam less.sympatico. ca> wrote in message
        news:efaj1nMUFH A.3140@TK2MSFTN GP14.phx.gbl...[color=blue]
        > This is what I get that that:
        >
        > "\"C:\\prog ram files\\program dir\\prog.exe\" /B \"C:\\config
        > files\\files1.t xt\""
        >
        > That is right out of the watch window
        >
        > "Jared Parsons [MSFT]" <jaredpar@onlin e.microsoft.com > wrote in message
        > news:Olkq0iMUFH A.752@TK2MSFTNG P10.phx.gbl...[color=green]
        >> Try
        >>
        >> @"""c:\progr am files\program dir\prog.exe"" /B ""c:\config
        >> files\file1.txt """
        >> --
        >> Jared Parsons [MSFT]
        >> jaredpar@online .microsoft.com
        >> http://blogs.msdn.com/jaredpar
        >> "This posting is provided "AS IS" with no warranties, and confers no
        >> rights"
        >> "Lee" <latrotter@spam less.sympatico. ca> wrote in message
        >> news:eWfG8dMUFH A.2124@TK2MSFTN GP14.phx.gbl...[color=darkred]
        >>> Hi All,
        >>>
        >>> I need to make a string look like this. I am calling a program and need
        >>> to send args to it.
        >>>
        >>> "c:\program files\program dir\prog.exe" /B "c:\config files\file1.txt "
        >>>
        >>> The quotes need to be passed exactly as they are in that string or it
        >>> will not work. I need the quotes or I end up getting things trucated.
        >>>
        >>> Thanks
        >>>
        >>> Lee
        >>>[/color]
        >>
        >>[/color]
        >
        >[/color]


        Comment

        Working...