hi,
how to remove character in string
my string is Input
1,2,3,4,5,6,7,8,9,10,11,12
out put is (Remove character 1)
2,3,4,5,6,7,8,9,10,11,12
when I use replace funtion than
my output is like this
2,3,4,5,6,7,8,9,0,,2
Thanks,
Jitendra Patel
Loading
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
DRISHTYPosted May 21, 2010, 9:27 AM
try this:
string s1="1,2,3,4,5,6,7,8,9,10,11,12";
MessageBox.Show(s1.Substring(2,s1.Length-2));
CrishPosted May 21, 2010, 6:17 AM
No need to use replace function.
use split function and count your length of the string. store this string in array. make loop and for this array, Then start count from 1 not zero using array..
U can also use substring function for starting from particular index of string
Split function :