C # stringbuilder. Replace method (char, Char, int32, int32)

Source: Internet
Author: User

Replace the matching items of all specified characters in the substring of this instance with other specified characters.

Namespace: system. Text
ProgramSet: mscorlib (in mscorlib. dll)

Syntax
C #
Public stringbuilder Replace (
Char oldchar,
Char newchar,
Int startindex,
Int count
)
Parameters
Oldchar
The character to be replaced.

Newchar
Replace the oldchar character.

Startindex
The starting position of the substring in this instance.

Count
The length of the substring.

Return Value
References to this instance, where oldchar from startindex to startindex + count-1 is replaced by newchar.
Exception
Exception type condition
Argumentoutofrangeexception
Startindex + count is longer than the Instance value.

-Or-

Startindex or count is smaller than zero.

Remarks
The size of stringbuilder remains unchanged, because it only replaces characters. This method is case sensitive.

Platform
Windows 98, Windows 2000 SP4, Windows CE, Windows Millennium Edition,
Windows Mobile for Pocket PC, Windows Mobile for smartphone,
Windows Server 2003, Windows XP Media Center edition,
Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

. NET Framework does not support all versions of each platform. For a list of supported versions, see system requirements.

Version Information
. NET Framework
Supported by the following versions: 2.0, 1.1, and 1.0

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.