C
C#8mo ago
%Anhangüera

❔ Working with string builder

I wonder if there is a way that I can avoid passing the string to be formatted in the AppendFormat method, since I can set the value of the string in the StringBuilder class
No description
6 Replies
phaseshift
phaseshift8mo ago
If thats all youre doing with it, then just use an interpolated string
x0rld
x0rld8mo ago
btw the commitMessage can be a const
%Anhangüera
%Anhangüera8mo ago
idk, I think that would be harder in general ticketnumber and minute have some validations and variations
phaseshift
phaseshift8mo ago
append-format is doing exactly the same work as an interpolated string in terms of creating the basic string value from arguments You could be using return $"..."; instead of return _strBldr.AppendFormat(...).ToString(); Like, if you doht have multiple calls to builder methods, what is the point of using the builder? But to your original question, no, I dont think so
%Anhangüera
%Anhangüera8mo ago
hmmm, yeah, I think that makes sense :)
Accord
Accord8mo ago
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.
Want results from more Discord servers?
Add your server
More Posts
❔ Is my Unity + VS setup correctly? (NEWBIE HELP:C)I am NEW and I mean NEW to the coding world as well as computers and I was interested in making a ga❔ factorial using equationSo i am stuck on this task where i have to also use equation for example 1*1 =1 1*2=2 2*3=6 and i sWeird behaviour if I included code after File.ExistsSo the EvaluateDbFile function is checking if a db file exists, if I leave it as it is now it evalua❔ Big Problem in C# plz someone helpso i'm new to coding (just so you know so if you say something to advanced i will maybe not know wha❔ How do I name an object after a variable in that object?I have a class with a variable called "name", how would i make "name" the name of the object?❔ Hi for some reason this exercise on indexing isnt clicking for me can someone guide me this?1-im used to properties that have a name this property has no name so i guess it refers to the class❔ Limit incremental generator's RegisterPostInitializationOutput() call to one specific assemblyIs it possible to add an attribute declaration code to a single assembly and let the code generation❔ What happening in background when i return Task.CompletedTask?I just wonder, what c# doing if i have async method returning Task.completedTask? does it try to syn✅ Razor pages, not reaching OnPost methodI have made a <form method="post"> and within it i have a <button type="submit" >. when i click on ❔ Visual Studio build error: "mark of the web"???Get this error every time I try to build my project. All I did was add a toolstrip to a form and now