article

Complete String Manipulation

Email
Submitted on: 1/4/2015 3:09:00 AM
By: Dennis M. Santiago (from psc cd)  
Level: Beginner
User Rating: By 9 Users
Compatibility: VB.NET, C++.NET
Views: 1764
 
     It's a part of my program title complete vb.net functions that include all vb.net functions, financial, file i/o, math etc., This Tutorial help you a lot to format convert string..,

 
				Complete String Manipulation 
Asc(), AscW(), Chr(), ChrW(), Filter(),
InStr(), InStrRev(), Join(), LCase(),
Left(), Len(), LTrim(), Mid(), Mid, 
Replace(), Right(), RTrim(), Space(),
Split(), StrComp(), StrConv(), StrDup(), StrReverse(), Trim(), UCase()
-------------------------------------------------
Asc(character), AscW(string)
The Asc() function returns the character
code corresponding to the character argument
The AscW() function returns the Unicode character 
code except on platforms that do not support
Unicode.
ex. Output = Asc(W)(MysingleString) MysingleString = w output =119
_________________________________________________
Chr(Value as Integer)
The Chr() function is the inverse of the Asc() function and returns the character associated 
with the specified character code. Use this function to print characters that donít appear 
on the keyboard (such as line feeds or special symbols).
The ChrW() function returns a string containing the Unicode character except on platforms that donít support Unicode, in which case, the behavior is identical to that of the Chr() function.
ex. Output = Chr(W)(MySingleString) MysingleString = 119 output =w
_________________________________________________
Filter(inputStrings, value[, include][, compare])
 
This function returns an array containing part of a string array
ex.
Dim intRecCnt As Integer
Dim intCntr As Integer
Dim selNames() As String
Dim Names() As String _ = "Dennis", "Manjon", "Santiago"}
 'Create the Filtered array from the Full array
selNames = Filter(Names, MyInputString)
 'Determine the number of elements in the array
intRecCnt = UBound(selNames)
 'Add Elements to ListBox for each element
 'in the array
For intCntr = 0 To intRecCnt
 LBOutput.Items.Add(selNames(intCntr))
Next intCntr
MyInputString ="Dennis" 
the Output get the Location = 1
________________________________________________
InStr([startPos,] string1, string2[, compare])
InStrRev(string1, string2[, start][, compare]) #
InStr(InputString1, _ InputString2,CompareMethod.Text)
I choice CompareMethod.Text, if the the Input string is equal then it return 1 else 0 
__________________________________________________
Join(list[, delimiter])
Dim ArrayList() As String = {"Dennis", "Santiago"}
txtOutPut.Text = "The output is : " & Join(ArrayList, MyJoinString)
MyJoinString " Manjon " Output Dennis manjon Santiago
__________________________________________________
LCase(String) convert to lowercase
ex. lCase(D) output = d
__________________________________________________
Left(string, Length)
Output = Left("Dennis",2) = "De"
__________________________________________________
len(String) 
len(Dennis) 
 Output =6
_________________________________________________
LTrim(string) LTrim() RemoveSpace from left until not found Character
 output = L Trim(" Dennis ")
Result= "Dennis "
__________________________________________________
Mid(string, start, [length])
Str = Mid("Dennis",2 ,"3")
Output = enn
_________________________________________________
Replace(expression, find, replacewith[, start][, count][, compare])
Replace("Dennis Santiago", "Dennis", "Den")
Output = Den Santiago
_________________________________________________
Right(String,Length)
Output = Right("Dennis",3)
output =nis
_________________________________________________
RTrim(string) Remove space from the rightside
Output = Rtrim("Dennis")
output="Dennis"
__________________________________________________
Space(number)
Space(3) 
make 3 space
_________________________________________________
Split(expression[, delimiter][, count][, compare])
 This function is the counterpart of the Join() function. It returns a one-dimensional array containing a number of substrings.
Split("Dennis Santiago","Den" , 2)
Output = Nis Santiago
__________________________________________________
StrComp(string1, string2[, compare])
ValueDescription
Ė1 string1 is less than string2.
 0 string1 is equal to string2.
 1 string1 is greater than string2.
StrComp("Dennis", "Santiago")
output = -1
_________________________________________________
StrConv(string, conversion)
enter a Number on Conversion 1 to 9 For String Format
StrConv("Dennis", 1)
Output = DENNIS
__________________________________________________
StrDup(number, character)
This function returns a string of number 
characters, all of which are character
StrDup(3, "d")
Output = DDD
_________________________________________________
StrReverse(string)
output = StrReverse("Dennis")
Output =sinneD
_________________________________________________
Trim(String) 
Remove all Space on String both left and right
Output = Trim(" Dennis ")
output = "Dennis"
_________________________________________________
UCase(string) 
Convert to uppercase
Output =UCase("Dennis")
Output = DENNIS
_________________________________________________
By: Dennis M. Santiago :Email Add Explicitmaker@yahoo.com--- don't forget to VOTE for me |-:) Thanks


Other 2 submission(s) by this author

 


Report Bad Submission
Use this form to tell us if this entry should be deleted (i.e contains no code, is a virus, etc.).
This submission should be removed because:

Your Vote

What do you think of this article (in the Beginner category)?
(The article with your highest vote will win this month's coding contest!)
Excellent  Good  Average  Below Average  Poor (See voting log ...)
 

Other User Comments


 There are no comments on this submission.
 

Add Your Feedback
Your feedback will be posted below and an email sent to the author. Please remember that the author was kind enough to share this with you, so any criticisms must be stated politely, or they will be deleted. (For feedback not related to this particular article, please click here instead.)
 

To post feedback, first please login.