C
C#

help

❔ ✅ using multiple methods to object

RRyan-T141212/24/2022
.
RRyan-T141212/24/2022
ok so before reversing the string we should convert it to an array, right? why it's not number.ToArray().Reverse()
TThinker12/24/2022
string already implements IEnumerable<char> so there's no need to
TThinker12/24/2022
Also new string(numb.ToString()) isn't necessary, you can just do numb.ToString()
RRyan-T141212/24/2022
how about next line ?
string reversedNumber = new string(number.Reverse().ToArray());
string reversedNumber = new string(number.Reverse().ToArray());
if i remove new string it gaves an error
TThinker12/24/2022
You need it there because ToArray() returns a char[], and new string creates a string from a char[] .
RRyan-T141212/24/2022
i see
string reversedNumber = number.Reverse();
string reversedNumber = number.Reverse();
but what if i do it like this insted of converting string -> array -> string
TThinker12/25/2022
That won't work because you can't convert an IEnumerable<char> to a string.
Eero12/25/2022
Now i wonder what the fastest way to reverse is...
TThinker12/25/2022
string.Create probably
Eero12/25/2022
Because it always is But there's more nuance to it Because you don't necessarily have to turn the number into a string first
TThinker12/25/2022
however, that was not the question, so let's not get sidetracked catsip
Eero12/25/2022
I wanna side track!
TThinker12/25/2022
go to #allow-unsafe-blocks when
RRyan-T141212/25/2022
thank you !close
AAccord12/26/2022
Closed! Was this issue resolved? If so, run /close - otherwise I will mark this as stale and this post will be archived until there is new activity.

Looking for more? Join the community!

Want results from more Discord servers?
Add your server
Recommended Posts
❔ How to make instantiated object move with transform function?I'm quite new to Unity, so this might be really easy. public GameObject cell; public float spee❔ ✅ how to sort numbers in list without using funcitonshow can i sort numbers in a list without using reverse?❔ ✅ method array arg error.✅ how can i x amount of times ask the user to input a number and save it in a listso i need to make inputted numbers in negative my problem is i read the how many numbers does he w❔ Html.Agility Pack selecting all div nodes by class (more then one)?Hi, I have and html document and there are multiple div classes in there (embedded like a treeview)CSharp how to make an http request get and post for browser AI browsing like login on a website etcMy problem is the next I m trying to login on a website via C# win forms project app I m stuck at th❔ logs with network file sendingHello there, I'm currently in the process of writing a FTP server and I want to implement a logging ❔ How can I delete a componentFor example: AddComponent<RigidBody>(); //for add rigid body //But how i delete that rigid body¿❔ ✅ printing array like this [7, 14, 21, 28, 35] inside of brackets.Html.Agility Pack selecting all div nodes by id (more then one)?Hi, I have and html document and there are multiple div tags in there (embedded like a treeview) A❔ how To create a view that can accept range of inputs, for models range for DbSet.AddRange methodThis is my View Model where i am sending an Ienumarable of Model Option to get range of option for t❔ list patterns net 7any use case of List patterns in project? , can we use List<T>?❔ Arrow key support Win FormHello i was wondering how i could implement arrow keys to navigate through buttons at the current po❔ ✅ error CS8803 Top-level statements must precede namespace and type declarations..❔ Linq statement doesn't work```csharp .Where(i => strArray.Any(s => i.Name.Contains(s))) ``` I have an array of strings `[ "t❔ ✅ public class.❔ Moving from consoleapp to wpf?hi im fairly new to programming and I want to take this code https://pastebin.com/F2cZ5Anb and placeLinq to select where Name contains substring?```csharp var dynContentList = await _context.DynamicContents .OrderBy(x => x.OrderI❔ Linux Mint .NET is installed but cmds such as run, new console, etc. are not recognised...I am thinking of switching to Linux but cannot get .NET SDK and runtime installed correctly for some✅ VerificationExceptionA friend of mine has a method that uses the Reflection.Emit namespace to create a method with the fo