substring in c# example without string functions.

Posted by Sekar.C under C# on 5/8/2012 | Points: 10 | Views : 5068 | Status : [Member] | Replies : 2
Hi,
substring in c# example without string functions.

Regards
sekar.c

Regards
Sekar.c



Responses

Posted by: Prabhakar on: 5/8/2012 [Member] [MVP] Starter | Points: 25

Up
0
Down
Hello.. Sekar.C

Say ur Full Requirement . . if u want to Substring in a Textbox so use like this . .


txtemail.Text.Substring(0, 3);


Hope fully it's work for u . .

Best Regard's
Prabhakar

Sekar.C, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Sakthi.Singaravel on: 5/8/2012 [Member] Silver | Points: 25

Up
0
Down
private void button1_Click(object sender, EventArgs e)

{
string str1 = "substring";
char substr;
int count = 0;
bool flag = true;
foreach (char c in str1)
count++;
for (int i=0,j=3;j<=count -1;i++, j++)
substr[i]=str1[j]; //Here u can get 4th character to last character
MessageBox.Show ("Sub String=" & substr.toString);
}


Regards,
Singaravel M

Sekar.C, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response