ATOUTFOX
COMMUNAUTÉ FRANCOPHONE DES PROFESSIONNELS FOXPRO
Visual FoxPro : le développement durable

Forum AtoutFox : Re: [C#] strtran   

Sujet

rss Flux RSS des derniers messages

Vous devez vous identifier pour pouvoir poser une question ou répondre.

jeu. 24 avril 2008, 08h51
Gregory
atoutfox.public.association

Re: [C#] strtran

Olivier,

Il y a deux facons d'appeler Replace

Replace(Char, Char) Replaces all occurrences of a specified Unicode
character in this instance with another specified Unicode character.
Replace(String, String) Replaces all occurrences of a specified String in
this instance, with another specified String.

Pour eliminer des char

string s = "aa.bb.cc";

Console.WriteLine(s.Replace(".", null)); // aabbcc

Gregory
_

"OlivierH" <"nospam[contact]"@planitron.com> wrote in message
news:fuo90s$pbl$1@news.niouzes.net...
> Bonsoir,
>
> voici la solution pour ceux qui ont besoin,
> j'ai 3 solution (comme fox !)
>
> maChaine.Replace("\r", "###");
> ou
> maChaine.Replace(Convert.ToChar(13).ToString(), "123 ");
> ou
> maChaine.Replace(((char)13).ToString(), "&&& ");
>
> Olivier
>
>
>
> OlivierH a écrit :
>> Bonjour à tous,
>>
>> J'aimerais faire un strtran(machaine,chr(13)," ") en c#
>> et j'ai un probleme avec le chr(13) qui s'ecrit (char)13
>>
>> Voila mon code :
>> maChaine.Replace((char)13, " ");
>>
>> Et pourtant console.writeline("test"+(char)13); // fonctionne !
>>
>> Comment puis je ecrire un saut de ligne en c#
>>
>> D'avance merci
>> Olivier
>>

--
Gregory
__
Permalink : http://www.atoutfox.org/nntp.asp?ID=0000002308
20 286 messages dans le forum • Liste complète des messages

www.atoutfox.org - Site de la Communauté Francophone des Professionnels FoxPro - v3.4.0 - © 2004-2026.
Cette page est générée par un composant COM+ développé en Visual FoxPro 9.0-SP2-HF3