|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Replacing string characterHi
How can I replace all occurrences of a character in a string to another character? Thanks Regards John wrote:
> Hi Use the .Replace method of the string> > How can I replace all occurrences of a character in a string to another > character? > > Thanks > > Regards > > ..Replace("char that will be replaced","char to replace original char") Dim temp as string = "ThisStringIsATest" Dim result as string = temp.Replace("T","$") 'Replaces every occurence of "T" with "$" Hi,
It may sound silly, but... Try the string's Replace method. Example: Buffer = Buffer.Replace(comecharsequence, someothercharsequence) Dick -- Richard Grier, MVP Hard & Software Author of Visual Basic Programmer's Guide to Serial Communications, Fourth Edition, ISBN 1-890422-28-2 (391 pages, includes CD-ROM). July 2004, Revised March 2006. See www.hardandsoftware.net for details and contact information. "John" <John@nospam.infovis.co.uk> schrieb: 'System.String.Replace', 'Microsoft.VisualBasic.Strings.Replace', > How can I replace all occurrences of a character in a string to another > character? 'System.Text.RegularExpressions.Regex.Replace'. -- M S Herfried K. Wagner M V P <URL:http://dotnet.mvps.org/> V B <URL:http://classicvb.org/petition/> |
|||||||||||||||||||||||