Atlanta Custom Software Development 

 
   Search        Code/Page
 

User Login
Email

Password

 

Forgot the Password?
Services
» Web Development
» Maintenance
» Data Integration/BI
» Information Management
Programming
VB VB (1648)
VB.net VB.net (736)
C# C# (15)
ASP.net ASP.net (779)
ASP ASP (41)
VC++ VC++ (25)
PHP PHP (0)
JAVA JAVA (4)
JScript JScript (5)
  Database
» SQL Server (708)
» ORACLE (5)
» MySQL (0)
» DB2 (0)
Automation
» C/C++/ASM (11)
» Microcontroller (1)
» Circuit Design (0)
OS/Networking
» Networking (5)
» Unix/Linux (1)
» WinNT/2k/2003 (8)
Graphics
» Flash (0)
» Maya (0)
» 3D max (0)
» Photoshop (0)
Links
» ASP.net (2)
» PC Interfacing (1)
» Networking (4)
» SQL Server (4)
» VB (23)
» VB.net (4)
» VC (3)
» HTML/CSS/JavaScript (10)
Tools
» Regular Expr Tester
» Free Tools

(Page 1 of 2) 43 Result(s) found 

 

Determine whether a string is lowercase
Total Hit (3239) Here's a quick-and-dirty method to determine whether a string contains only lowercase characters «Code LangId=2» ' the string to test is in the SOURCE variable If System.Text.RegularExpressions.Regex.IsMatch(source, "^[a-z]+$") Then Console.WriteLine("Lowercase string") End If «/Code» ....Read More
Rating
Determine whether a string is uppercase
Total Hit (3057) Here's a quick-and-dirty method to determine whether a string contains only uppercase characters «Code LangId=2» ' the string to test is in the SOURCE variable If System.Text.RegularExpressions.Regex.IsMatch(source, "^[A-Z]+$") Then Console.WriteLine("Uppercase string") End If «/Code» ....Read More
Rating
Faster string comparison with the Is operator
Total Hit (3200) .NET strings are objects, so what you store in a String variable is actually a reference to a String object allocated in the managed heap. Even though the VB.NET compiler attempts to hide the object nature of strings as much as it can - for example, you don't need to declare a String object with a N ....Read More
Rating
Faster string comparisons with CompareOrdinal
Total Hit (3640) You can compare strings in many ways under VB.NET: by using the = operator (or another comparison operator), with the Equals method (which the String class inherits from System.Object), or with the Compare shared method. The Compare method is especially useful because it returns an integer that tell ....Read More
Rating
Iterating over the characters in a string
Total Hit (2856) Visual Basic .NET strings support the For Each statement, so you can iterate over each individual character as follows: «Code LangId=2» Dim s As String = "ABCDE" Dim c As Char For Each c In s Console.Write(c & ".") ' => A.B.C.D.E. Next «/Code» However, you should bear in mind th ....Read More
Rating
Locale-aware string conversions
Total Hit (2745) You can use the usual UCase, LCase, and StrConv functions to convert a string to upper, lower, and titlecase (e.g. "This Is A Title"). However, VB.NET offers is much more flexible, and lets you convert the case of a string according the locale you specify. You can do this through the methods of the ....Read More
Rating
Process string faster with the StringBuilder class
Total Hit (2844) You can think of a StringBuilder object as a buffer that can contain a string with the ability to grow from zero characters to the buffer's current capacity. Until you exceed that capacity, the string is assembled in the buffer and no object is allocated or released. If the string becomes longer tha ....Read More
Rating
Reducing string memory usage with the Intern method
Total Hit (2970) A .NET application can optimize string management by maintaining an internal pool of string values known as intern pool. If the value being assigned to a string variable coincides with one of the strings already in the intern pool, no additional memory is created and the variable receives the addres ....Read More
Rating
Right-align formatted strings
Total Hit (3307) The String.Format function supports many formatting options, but none allows you to display right-aligned columns of numbers, as in: 1.00 12.00 123.00 1,234.00 However, you can easily create a helper function that works like String.Format, takes an additional length argument, ....Read More
Rating
Trimming strings
Total Hit (3053) Visual Basic .NET strings expose three trim methods: TrimStart, TrimEnd, and Trim - which trim one or more characters from the beginning, the end, or both the beginning and end of the string. They therefore work like VB6's LTrim, RTrim, and Trim functions, with an important difference: you can decid ....Read More
Rating
IsValidEmail - Validate an email address
Total Hit (2624) «Code LangId=2» Function IsValidEmail(ByVal Value As String, Optional ByVal MaxLength As _ Integer = 255, Optional ByVal IsRequired As Boolean = True) As Boolean If Value Is Nothing OrElse Value.Length = 0 Then ' rule out the null string case Return Not IsRequired ....Read More
Rating
IsValidUsPhoneNumber - Validating a US phone number
Total Hit (2985) «Code LangId=2» ' Validate a US phone number ' Example: ' MessageBox.Show(IsValidUsPhoneNumber("(123) 456-7890")) ' True ' MessageBox.Show(IsValidUsPhoneNumber("(123) 456-78901")) ' False Function IsValidUsPhoneNumber(ByVal phnNum As String) As Boolean Return System.Text.RegularExp ....Read More
Rating
Concatenate an array of strings with commas and a final "and", or other separators
Total Hit (2673) «Code LangId=2»' Concatenate an array of strings with commas and a final "and", ' or other separators ' ' Example: ' Debug.WriteLine("Choose one from " & CreateStringList(New String() {"item1", ' "item2", "item3"})) ' ' => Choose one from item1, item2 and item3 Function CreateStringL ....Read More
Rating
ConcatenateStrings - Concatenating an array of strings
Total Hit (2710) «Code LangId=2»' Concatenate the input strings, and return the resulting string. The first ' input string is used as a separator. ' ' Example: ' Dim i As Integer = 4 ' Dim d As Double = 34.45 ' Dim s As String = "VB-2-The-Max" ' Dim ret As String = ConcatenateStrings(" ", s, "is a n ....Read More
Rating
CountOccurrences - Counting the number of string occurrences
Total Hit (2843) «Code LangId=2» ' Count the number of string occurrences Public Function CountOccurrences(ByVal source As String, ByVal search As String, _ Optional ByVal ignoreCase As Boolean = False) As Integer Dim options As System.Text.RegularExpressions.RegexOptions ' set the search options a ....Read More
Rating
DecodeBase64 - Decoding a string from base64
Total Hit (2887) «Code LangId=2»' Returns the input string decoded from base64 Private Function DecodeBase64(ByVal input As String) As String Dim strBytes() As Byte = System.Convert.FromBase64String(input) Return System.Text.Encoding.UTF8.GetString(strBytes) End Function «/Code» ....Read More
Rating
EncodeBase64 - Encoding a string to base64
Total Hit (3042) «Code LangId=2»' Returns the input string encoded to base64 Private Function EncodeBase64(ByVal input As String) As String Dim strBytes() As Byte = System.Text.Encoding.UTF8.GetBytes(input) Return System.Convert.ToBase64String(strBytes) End Function «/Code» ....Read More
Rating
EndsWith - Check whether a string ends with one of multiple possible choices
Total Hit (2685) «Code LangId=2»' Check whether a string ends with one of multiple possible choices. ' Return -1 if no possible string matches the end of the source, ' otherwise return the index of the matching string. ' ' Examples: ' Debug.WriteLine(EndsWith("This is my test line", True, "Line", ' "Stri ....Read More
Rating
ExplodeString - Add a filling char between a string's chars
Total Hit (2494) «Code LangId=2» ' "Explode" a string by inserting a given filling character ' between consecutive characters in the original string ' ' The source string cannot contain Chr$(0) characters Function ExplodeString(ByVal Source As String, Optional ByVal fillChar As Char = _ " "c) As String ....Read More
Rating
FlipCase - Inverting the case of all characters of the input string
Total Hit (2583) «Code LangId=2» ' Invert the case of all characters of the input string ' ' Examples: ' Debug.WriteLine(FlipCase("Hello World")) ' => hELLO wORLD ' Debug.WriteLine(FlipCase("hELLO wORLD")) ' => Hello World ' Debug.WriteLine(FlipCase("3) this is message n. 3")) ' => 3) THIS IS ' MES ....Read More
Rating
FormatMemorySize - Format a value in bytes
Total Hit (2762) «Code LangId=2» Enum FormatMemorySizeUnits BestGuess Bytes Kilobytes Megabytes Gigabytes End Enum ' convert a number of bytes into Kbytes, Megabytes, or Gigabytes Function FormatMemorySize(ByVal value As Long, _ ByVal unit As FormatMemorySizeUnits, Optional B ....Read More
Rating
FormatSize - Format a size expressed in bytes
Total Hit (2477) «Code LangId=2» ' Returns a formatted string that shows the size in Bytes, KBytes or MBytes ' according to the size ' Usage: ' Dim ProperSizeString As String = FormatSize("132100842") ' -> returns "125.98 MB" Function FormatSize(ByVal SizeInBytes As Double) As String If SizeInBytes ....Read More
Rating
FormatValue - Format a value in a column of given width
Total Hit (2711) «Code LangId=2» Enum FormatColumnAlignment Left Center Right End Enum ' format a value in a column of given width and with specified alignment ' using the specified pad character Function FormatValue(ByVal value As String, ByVal width As Integer, _ ByVal alignment As F ....Read More
Rating
GetDelimitedText - Extract the text between open and close delimiters
Total Hit (2759) «Code LangId=2»' get the text enclosed between two Delimiters ' ' it advances Index after the close delimiter ' Returns "" and Index = -1 if not found ' search is case sensitive ' ' For example: ' Dim source As String = " a sentence with (a word) in parenthesis" ' Dim i As Integer = 0 ....Read More
Rating
GetUrlParameters - Retrieving the key-value pairs from the specified url
Total Hit (2564) «Code LangId=2» ' Returns a hashtable with the key-value pairs extracted from the querystring ' of the specified url ' EXAMPLE: ' Dim ht As Hashtable = GetUrlParameters ' ("http://www.mysite.com?param1=123&param2=&param3=234") ' ' print the key=value pairs to the console window ' Di ....Read More
Rating
GetWordOccurrences - Number of occurrences of each word in a string
Total Hit (2530) «Code LangId=2» ' Returns a Hashtable whose keys are the unique words in a source string ' and whose elements are the number of occurrences of each word ' ' Example: ' ' Dim de As DictionaryEntry ' For Each de In GetWordOccurrences(sourceText) ' Console.WriteLine("'{0}' = {1} time(s), ....Read More
Rating
IncrementString- Incrementing the numeric right-most portion of a string
Total Hit (2824) «Code LangId=2» ' Increment the numeric right-most portion of a string ' Example: MessageBox.Show(IncrementString("test219")) ' => 220 Function IncrementString(ByVal text As String) As String Dim index As Integer Dim i As Integer For i = text.Length - 1 To 0 Step -1 Sel ....Read More
Rating
InstrTbl - Search a string for any character in a table
Total Hit (3577) «Code LangId=2» ' If INCLUDE is True or is omitted, return the first occurrence of a character ' in a group ' or -1 if SOURCE doesn't contain any character among those listed in TABLE. ' If INCLUDE is False, return the first occurrence of the character in SOURCE ' that does not appear in TABL ....Read More
Rating
InstrTblRev - The last occurrence of a char in a table
Total Hit (3352) «Code LangId=2»' If INCLUDE is True or is omitted, return the last occurrence of a character ' in a group ' or -1 if SOURCE doesn't contain any character among those listed in TABLE. ' If INCLUDE is False, return the last occurrence of the character in SOURCE ' that does not appear in TABLE. ....Read More
Rating
IsStringLower - Determine whether a string contains only lowercase characters
Total Hit (2630) «Code LangId=2» ' Returns True if a string contains only lowercase characters Function IsStringLower(ByVal sText As String) As Boolean Dim c As Char For Each c In sText If Not Char.IsLower(c) Then Return False Next Return True End Function «/Code» ....Read More
Rating


(Page 1 of 2) 43 Result(s) found  1 2

Recommanded Links

 

Home   |  Comment   |  Contact Us   |  Privacy Policy   |  Terms & Conditions   |  BlogsZappySys

© 2008 BinaryWorld LLC. All rights reserved.