Progress Monitor for IdealProgrammer.com
Take Swift, Intelligent, Massive, Planned, Loving, Effective (S.I.M.P.L.E.) Action to Transform Self into Ideal
Skip Repetitive Navigational Links
Home
News
Presenters
Register
Contact
Categories
Titles
Converter
Code Samples
C# ASP.NET
C# Console
HTML
JavaScript
SQL Server
VB ASP.NET
VB Console
Please login
C-Sharp Remove Example Syntax - C# String Function - Sample Code
Description:
Illustrates the C# Syntax for Remove.
Example Class Main:
using System; public class clsRemove { public void Main() { //**************************************************************************************** // Example #1: Remove(startIndex, count) // Returns a string with the specified number of characters removed starting at startIndex. // If no Count is specified, the remainder of string is removed //**************************************************************************************** Console.WriteLine("Example #1: Remove(startIndex, count) "); string strRemoveExample = "This is a test string"; int intIndexRemove = 0; // First find position of word test intIndexRemove = strRemoveExample.IndexOf("test"); // Remove rest of string starting with word "test" Console.WriteLine(strRemoveExample.Remove(intIndexRemove)); //write blank line to make output easier to read Console.WriteLine(); //Prevent console from closing before you press enter Console.ReadLine(); } }
Example Class Program:
using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace CSharp_Syntax { class Program { static void Main(string[] args) { clsRemove myRemove = new clsRemove(); myRemove.Main(); } } }
Home
News
Presenters
Register
Contact
Categories
Titles
Converter
Code Samples
C# ASP.NET
C# Console
HTML
JavaScript
SQL Server
VB ASP.NET
VB Console