[Mono-list] Fixing string

William Ivanski william.ivanski at gmail.com
Tue Feb 7 19:43:18 UTC 2017


In your code, replace member1 with string.Format("\"{0}\"", member1) .
The same way for the other members.

Em ter, 7 de fev de 2017 às 17:20, Sascha Manns <Sascha.Manns at mailbox.org>
escreveu:

> Hello list,
>
> i'm using that method for creating a string for using in the terminal:
>
> private static string PrepareRevision(string member1, string member2, string member3, string member4, string member5, string revnumber, string language)
> {
>     string revisionstring = " add_revision --member " + member1;
>     if (member2 != "")
>     {
>         revisionstring += " --member " + member2;
>
>         if (member3 != "")
>         {
>             revisionstring += " --member " + member3;
>
>             if (member4 != "")
>             {
>                 revisionstring += " --member " + member4;
>
>                 if (member5 != "")
>                 {
>                     revisionstring += " --member " + member5;
>                 }
>             }
>         }
>     }
>
>     if (revnumber != "")
>     {
>         revisionstring += " --revnumber " + revnumber;
>     }
>
>     if (language != "")
>     {
>         revisionstring += " --lang " + language;
>     }
>     Console.WriteLine(revisionstring);
>     return revisionstring;
> }
>
>
> The string looks like: add_revision --member Lorem ipsum dolor1 --member
> Lorem ipsum dolor2 --member Lorem ipsum dolor3 --member Lorem ipsum dolor4
> --member Lorem ipsum dolor5 --revnumber 0.79.2-4 --lang de-DE
>
> But i need a string which looks like: add_revision --member "Lorem ipsum
> dolor1" --member "Lorem ipsum dolor2" --member "Lorem ipsum dolor3"
> --member "Lorem ipsum dolor4" --member "Lorem ipsum dolor5" --revnumber
> 0.79.2-4 --lang de-DE
>
> Is this possible?
>
> Greetings Sascha
> _______________________________________________
> Mono-list maillist  -  Mono-list at lists.dot.net
> http://lists.dot.net/mailman/listinfo/mono-list
>
-- 

William Ivanski - Microsoft MVP
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.dot.net/pipermail/mono-list/attachments/20170207/2490fcf8/attachment.html>


More information about the Mono-list mailing list