Search This Blog

2009-04-17

Some common general important method for .NET

some general utility class for .NET.I have created some common general utility method in a class named as "GeneralUtility.cs".Most of the important function like Convert To Double Array,Convert To one dimensional Array,Empty All Control,Empty All Textbox Control,Create String From Array,convert Excel To CSV,Reverse a number or Reverse a string,Refresh Parent Window,Number to word etc.

public static string IncrementID(string inputString, int incrementValue){/*** Increments any given ID by a specified amount* param String inputString* param int incrementValue* return String returnString - incremented string* Assumes the ID field comprises of a String part* and an Integer part. The ID string first is read from right to left* and divided into the Integer Part and then the String part.* The Integer part is reversed and then incremented and the final result* string is formed by concatenating the Integer and String parts* reversed (since they were read from right to left at first).*/StringBuilder integerPart = new StringBuilder(12);StringBuilder stringPart = new StringBuilder(12);bool stillIntegerPart = true;char[] inputCharArray = new char[15];string returnString = "";