Arrays are very helpful to storing multiple values at a time.we are done/write many typical logical programs through arrays easily.Normally we are not write the program for removing spaces in a given string and ',' in a string like that but through using arrays methods we are done easily in c#.net.
Questions and Answers
class A
{
static void main()
{
String s="i,am,kasi";
Console.WriteLine(s);
s=s.Replace(',',',');
Console.WriteLine(s);
}
}
Output
I am Kasi
Q)Write a program to remove Spaces in a given string?
class A
{
static void main()
{
string s="i am kasi";
string[] s1=s.split('');
for(int i=0;i<=s1.length-1;i++)
{
Console.WriteLine(s1[i]);
}
Console.WriteLine();
}
}
Hi Friends You Like My Post Please Share To Your Friends Through Facebook,Twitter,Google+ etc and you feel free comment your answers also.
Hi Friends You Like My Post Please Share To Your Friends Through Facebook,Twitter,Google+ etc and you feel free comment your answers also.
0 comments:
Post a Comment