locked
Newbie string issue RRS feed

  • Pergunta

  • 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


    • Editado Y a h y a quarta-feira, 2 de setembro de 2020 16:57
    quarta-feira, 2 de setembro de 2020 16:56

Respostas

  • 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

    • Marcado como Resposta Y a h y a quarta-feira, 2 de setembro de 2020 20:09
    quarta-feira, 2 de setembro de 2020 18:51

Todas as Respostas

  • 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

    quarta-feira, 2 de setembro de 2020 18:28
  • 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

    • Marcado como Resposta Y a h y a quarta-feira, 2 de setembro de 2020 20:09
    quarta-feira, 2 de setembro de 2020 18:51