|
Split2 - A Split variant that parses multiple lines of text
|
Total Hit (1703) |
«Code LangId=1»
' A Split variant that parses a string that contains
' row and column separators, and returns a 2-dimensional array
'
' the result String array has a number of columns equal
' to the highest number of fields in individual text lines
Function Split2(ByVal Text As String, Opti
....Read More |
Rating
|
|
|
|
|
SplitTbl - Split a string with multiple delimiters
|
Total Hit (1841) |
«Code LangId=1»' A variant of the Split function, that offers the following improvements
' You can pass a list of valid delimiters to the second argument
' (however, only single-char delimiters are accepted)
' Differently from the regular Split function, consecutive occurrences
' of del
....Read More |
Rating
|
|
|
SplitWithQualifiers - An improved version of the Split function
|
Total Hit (2202) |
«Code LangId=1»' A variant of the Split function, that offers the following improvements
' You can pass text qualifier as the third argument and optionally specify
' to treat consecutive occurrences of delimiters as one
' For example, the following source text contains comma inside one of
....Read More |
Rating
|
|
|
StripControlChars - Delete control characters in a string
|
Total Hit (1787) |
«Code LangId=1»
' Strip all control characters (ASCII code < 32)
'
' If the second argument is True or omitted,
' CR-LF pairs are preserved
Function StripControlChars(source As String, Optional KeepCRLF As Boolean = _
True) As String
Dim index As Long
Dim bytes() As Byte
....Read More |
Rating
|
|
|
|
|
|
UniqueWords - Extract all individual words in a string
|
Total Hit (1690) |
«Code LangId=1»
' build a list of all the individual words in a string
'
' returns a collection that contains all the unique words.
' The key for each item is the word itself
' so you can easily use the result collection to both
' enumerate the words and test whether a given word appears
'
....Read More |
Rating
|
|
|
|
|
|
|
|
Floating Point Numbers Validation
|
Total Hit (1977) |
«Code LangId=1»Private Sub Form_Load()
Text1.Text = Empty
End Sub
' USAGE
'Create a form a text box
Private Sub Text1_KeyPress(KeyAscii As Integer)
' Precision is 2 in this case
' Send the Precision Value same in both the Functions
Call ValidateNum(Text1, 2, KeyAscii)
End
....Read More |
Rating
|
|
|
|
|
Working with string APIs
|
Total Hit (2357) |
«code LangId=1»Private Declare Function lstrcat Lib "kernel32" Alias "lstrcatA" ( _
ByVal lpString1 As String, _
ByVal lpString2 As String) As Long
Private Declare Function lstrcmp Lib "kernel32" Alias "lstrcmpA" ( _
ByVal lpString1 As String, _
ByVal lpString2
....Read More |
Rating
|
|
|
How to convert all accent char to normal char (Only for win2k)?
|
Total Hit (2286) |
This example will show you how to convert all accent characters to normal character.
«b»Step-By-Step Example«/b»
- Create a standard exe project
- Add the following code in form1
«code LangId=1»Private Declare Function FoldString _
Lib "kernel32" Alias "FoldStringA" ( _
ByVal dwMapFlags
....Read More |
Rating
|
|
|
How to sort string Array using CompareString API
|
Total Hit (3055) |
CompareString compares two strings and determines which one would come first in an alphabetic sort. Although this function can use a number of different comparisons, by default it conducts a case-sensitive word sort. In a word sort, all symbols except hyphens and apostrophes come before the letter "
....Read More |
Rating
|
|
|
|
|
StringBuilder Class for VB
|
Total Hit (1775) |
If you need to build a string by adding lots of pieces together, VB's string handling is slow because a new string is created in memory every time a new piece is added. This article presents a class which allocates a string chunk and then uses memory copy methods to manipulate the data within the sa
....Read More |
Rating
|
|