![]() |
|
[.NET] Replace text in files class - Printable Version +- Hack Forums (https://hackforums.net) +-- Forum: Tech (https://hackforums.net/forumdisplay.php?fid=444) +--- Forum: Coding (https://hackforums.net/forumdisplay.php?fid=151) +---- Forum: Software Development (https://hackforums.net/forumdisplay.php?fid=118) +---- Thread: [.NET] Replace text in files class (/showthread.php?tid=5524824) |
Replace text in files class - x64 - Jan 16, 2017 Hello everyone, So I had to make a little program for a test on school. And this program needed to replace text in files. You could choose between directories/subdirectories etc. And some of you might need some help with that. So I decided to post it on HF. Here is the class: Code public class FileReplacePlease say what I could improve or what I did good š * - BahNahNah - Jan 16, 2017 Your case insensitive search makes the entire line lowercase. You could do something like this: Spoiler (Click to View) * - Hawk HF - Jan 16, 2017 (Jan 16, 2017 04:30 AM)BahNahNah Wrote: Your case insensitive search makes the entire line lowercase. You could do something like this: Waittt... I feel like I remember you bitching about same-line brackets. š * - BahNahNah - Jan 16, 2017 (Jan 16, 2017 06:52 PM)Hawk HF Wrote: Waittt... I feel like I remember you bitching about same-line brackets. š Ikr. I was ment to work on a project with someone that would only use same line brackets, so I switched vs to it and never changed it back. + that I'm learning golang which won't compile unless the brackets are on the same line. There is an argument for both styles, but I do like the compactness of same line. * - Hawk HF - Jan 16, 2017 (Jan 16, 2017 06:59 PM)BahNahNah Wrote: Ikr. I've actually switched to new line brackets for the same reason lol. It's just a standard where I work. * - Sn0wX - Jan 17, 2017 (Jan 16, 2017 04:30 AM)BahNahNah Wrote: Your case insensitive search makes the entire line lowercase. You could do something like this: No you should not do some thing like that fucktard. Lets ignore the fact it's to hard for you to post in the correct section. Do not try to teach others when you have not even read bloody msdn for the methods you use. String.Equals Method (String,āStringComparison) is already overloaded to handle case. Try reading first https://msdn.microsoft.com/en-us/library/c64xh8f9(v=vs.110).aspx You also use tolower and have no idea what its meant for.... As explained in Best Practices for Using Strings in the .NET Framework, we recommend that you avoid calling string casing methods that substitute default values and instead call methods that require parameters to be explicitly specified. To convert a character to lowercase by using the casing conventions of the current culture, call theToLower(CultureInfo) method overload with a value of CultureInfo.CurrentCulture for its culture parameter. But how can we expect any thing from you when you cant post VB in a vb section. * - BahNahNah - Jan 17, 2017 (Jan 17, 2017 07:46 PM)Sn0wX Wrote: No you should not do some thing like that fucktard. Lets ignore the fact it's to hard for you to post in the correct section. I was not aware that string.Equals supported case insensitive comparison, so thanks for pointing that out. I diddnt say should, i said could. Im very aware that my code is not optimized, it was just concept code to present other ways of doing things. OPs code was c#, so i provided c#. * - gigajew - Jan 20, 2017 (Jan 16, 2017 04:30 AM)BahNahNah Wrote: Your case insensitive search makes the entire line lowercase. You could do something like this: Don't you mean if(CaseInsensitive) ? |