Muhammad Hammad
Muhammad Hammad
CC#
Created by Muhammad Hammad on 11/3/2024 in #help
sqlite table question
No description
12 replies
CC#
Created by Muhammad Hammad on 10/5/2024 in #help
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
CC#
Created by Muhammad Hammad on 7/13/2024 in #help
✅ GetLength vs .Length
static void Main(string[] args)
{
int[,,] ints = new int[,,] {

{ {1,2,3},
{4,5,6},
{7,8,9} },
{
{10,10,11},
{11,12,13},
{12,13,14}

}


};
for (int i = 0; i < ints.GetLength(0); i++)
{
for (int j = 0; j < ints.GetLength(1); j++)
{
for(int k = 0; k < ints.GetLength(2); k++)
{
Console.WriteLine(ints[i, j, k]);
}
}
}
Console.ReadLine();
}
static void Main(string[] args)
{
int[,,] ints = new int[,,] {

{ {1,2,3},
{4,5,6},
{7,8,9} },
{
{10,10,11},
{11,12,13},
{12,13,14}

}


};
for (int i = 0; i < ints.GetLength(0); i++)
{
for (int j = 0; j < ints.GetLength(1); j++)
{
for(int k = 0; k < ints.GetLength(2); k++)
{
Console.WriteLine(ints[i, j, k]);
}
}
}
Console.ReadLine();
}
the thing is .GetLength(0) doesn't need a -1 in the end while in .Length we do it like .Length-1
12 replies
CC#
Created by Muhammad Hammad on 7/5/2024 in #help
question about strings & stringbuilder!
this is the code
namespace Palindrome_Finder
{
internal class Program
{
static void Main(string[] args)
{
Console.WriteLine("Welcome to Our Palindrome Finder");
Console.WriteLine("Enter a Word or a Sentence to find if it's a Palindrome");
string UserInput = Console.ReadLine();
string processedInput=cleaner(UserInput);
Console.WriteLine($"Reversed Input: {processedInput}");
Console.ReadLine();

}
static string cleaner(string input)
{
string cleanedInput = input;
Console.WriteLine($" Original Input:{cleanedInput}");
foreach (char c in cleanedInput)
{

if(char.IsLetterOrDigit(c))
{
cleanedInput.Append(c);
}

}
string reversedInput = new string(cleanedInput.Reverse().ToArray());
return reversedInput;

}

}
}
namespace Palindrome_Finder
{
internal class Program
{
static void Main(string[] args)
{
Console.WriteLine("Welcome to Our Palindrome Finder");
Console.WriteLine("Enter a Word or a Sentence to find if it's a Palindrome");
string UserInput = Console.ReadLine();
string processedInput=cleaner(UserInput);
Console.WriteLine($"Reversed Input: {processedInput}");
Console.ReadLine();

}
static string cleaner(string input)
{
string cleanedInput = input;
Console.WriteLine($" Original Input:{cleanedInput}");
foreach (char c in cleanedInput)
{

if(char.IsLetterOrDigit(c))
{
cleanedInput.Append(c);
}

}
string reversedInput = new string(cleanedInput.Reverse().ToArray());
return reversedInput;

}

}
}
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
CC#
Created by Muhammad Hammad on 7/2/2024 in #help
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 that
30 replies
CC#
Created by Muhammad Hammad on 7/2/2024 in #help
C# carrier advice
give me some guys I wanna know what I can achieve by learning C# in 2024 7th month I have started already and on the basics I want to know some roadmaps, hoping to earn money with it!
27 replies
CC#
Created by Muhammad Hammad on 6/21/2024 in #help
✅ need C# challenges
I need 5 challenges for C# terminal based projects to hone my C# skills. okkey!
5 replies
CC#
Created by Muhammad Hammad on 6/21/2024 in #help
✅ 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