Testing Day (Loops)...
17 years ago
Just another developer Blog on the internet.... Talking to myself... Nobody listens...
// string[] -> ArrayList
string[] msg = this.message.Split('\n');
ArrayList arrayList = new ArrayList();
arrayList.AddRange(msg);
// ArrayList -> string[]
string[] arrayStrings = arrayList.ToArray(typeof(string)) as string[];
[PasswordPropertyTextAttribute(true)]
public string Password { get; set; }
if(i == 0) str = "Zero" else str = "Non Zero";
string str = x == 0 ? "Zero" : "Non Zero";
if (string.IsNullOrEmpty(str))
newstr = "i don't wanna be null"
else
newstr = str;
string newstr = str ?? "i don't wanna be null";
2. TryParse and ParseThe big difference between TryParse and Parse, is that the first one will return a boolean value, indicating if the conversion was successfull or not, and the second one will give you an exception if the convertion was not possible.
string AreYouADeveloper = "true"
if (bool.TryParse(AreYouADeveloper, out boolValue))
{
MessageBox.Show("welcome developer guy")
}
else
{
MessageBox.Show("You Are Not a Developer")
}
3. Exceptions cause performance to suffer significantlySince exceptions cause performance to suffer significantly, you should never use them as a way to control normal program flow, so the best way is to write code that avoids exceptions. If it is possible to detect in code a condition that would cause an exception, do so. Do not catch the exception itself before you handle that condition.4. .Net System.Diagnostics.DebuggerStepThrough Attribute Sometimes when you are running your code in debug mode, you don't want to stop in some methods, maybe because you already know that this method will always return what you want, because is not so important for the job you have in hands, or some other reasons... That's where the DebuggerStepThrough comes in. The compiler will add the necessary metadata preventing the debugger to step into the method. Even if you have this attribute defined, you can stop in, if you define a breakpoint there.
public string Name
{
[System.Diagnostics.DebuggerStepThrough]
get { return name; }
}
The world of blogging is growing up very fast. You have a lot to choose when you want to start writing your own blog.
I choose Blogger because it's simple, easy to work and via my gmail account.
But if you want to backup your blog, there is no official tool to do it.
I found on Codeplex a tool to backup a blog, very easy to use and very usefull.
The name of the tool is Blogger Backup.
Check it out now!
str1.ToLower() == str2.ToLower()
string.Compare(str1, str2, true) == 0 //Ignoring cases
if (str == "")
if (str == string.Empty)
ArrayList intList = new ArrayList();
intList.add(10);
return (int)intList[0] + 20;
List intList = new List();
intList.add(10)
return intList[0] + 20;
if (object1 != null && object1.runMethod())