locked
Newbie string issue RRS feed

  • Question

  • Hi

    In my token string I am getting extra \" on both ends and this fails subsequent calls to remote API for data. Even though I am using 

    oauthToken1 = oauthToken2.Replace("\\\"", "");


    to strip \" from both ends. Screen 1 below.

    The Output window however shows string fine. Screen 2 below.

    At present I manually edit out the \" from both ends in Watch window and get the subsequent API calls to succeed.

    How can I get rid of \" on both ends please and why do they appear in the first place?

    Thanks

    Regards

    Screen 1 

    Screen 2


    • Edited by Y a h y a Wednesday, September 2, 2020 4:57 PM
    Wednesday, September 2, 2020 4:56 PM

Answers

  • Try this too: oauthToken1 = oauthToken2.Trim('"') (i.e. apostrophe, quotation mark, apostrophe).

    To view the string, you can also type this expression into Watch window:

       oauthToken1,nq

    • Marked as answer by Y a h y a Wednesday, September 2, 2020 8:09 PM
    Wednesday, September 2, 2020 6:51 PM

All replies

  • Try:

    oauthToken1 = oauthToken2.Replace(@"\"", "");


    Looking for new opportunities

    For every expert, there is an equal and opposite expert. - Becker's Law


    My blog


    My TechNet articles

    Wednesday, September 2, 2020 6:28 PM
  • Try this too: oauthToken1 = oauthToken2.Trim('"') (i.e. apostrophe, quotation mark, apostrophe).

    To view the string, you can also type this expression into Watch window:

       oauthToken1,nq

    • Marked as answer by Y a h y a Wednesday, September 2, 2020 8:09 PM
    Wednesday, September 2, 2020 6:51 PM