Muhammad Hammad
C# winforms need help to do this..
I have a typing software I have virtual keyboard the expected key get's highlighted when it's needed to be pressed but I want to achieve one thing which is I want a virtual hand that is showing each finger placed over the default hand keys and then when the highlighting of needed keys by placing the hand finger on it I hope you got what I mean
3 replies
question about strings & stringbuilder!
this is the code
people say me use stringbuilder instead of appending to a string they say the way I did can be slower and resource consuming he don't reply further thought he is busy man can any gentleman teach me why is it he just said strings are immutable which is also what I don't think cuz I can add new value to strings I can assign new value to strings why they say they are immutable! help me this is confusing for me!
11 replies
seems like this doesn't work as intended!
static void Main(string[] args)
{
Console.WriteLine("Welcome to our Words Counter");
Console.Write("Put your paragraphs here to get words number's count: ");
string userInput = Console.ReadLine();
List<string> words = new List<string>();
string word = "";
for(int i=0; i<=userInput.Length-1;i++)
{
if (userInput[i]==' ')
{
if(!string.IsNullOrWhiteSpace(word))
{
words.Add(word);
word = "";
}
}
else
{
word += userInput[i];
}
//Adds the last word if the input doesn't end with a space
if (!string.IsNullOrWhiteSpace(word))
{
words.Add(word);
}
}
Console.WriteLine($"The ammount of words in your input are: {words.Count}");
Console.ReadLine();
}
}
It just counts character while I made it to count words! unable to spot the issue haven't spent more than 3 minutes to spot but thought of sharing it over here! I am sorry for that30 replies
✅ need visual studio C# offline installer please guys
I need to have an offline installer of visual studio with C# packages/workspace so I can use it offline in other systems also without downloading it at each place, I just need it for many reasons not alone this so please someone who has experience in this thing inform me out
5 replies