Hi
Given the fact that
a) VB.Net is completel;y objectoriented
b) Microsoft.Visualbasic namespace is given for backward
compatibility
suggest that u use the String Object props/methods like
length, substring instead of Functions like Right()
The following code sniper will do wat u want.
Watch for Line wraps
Right("abcde", 3) ' Will Return "cde"
Sub Right(ByVal p_strData As String, ByVal
p_intNoOfCharsToGet As Integer)
If Not p_strData Is Nothing AndAlso
p_strData.Length >= p_intNoOfCharsToGet Then
Console.WriteLine(p_strData.Substring
((p_strData.Length - p_intNoOfCharsToGet),
p_intNoOfCharsToGet))
End If
End Sub
regards,
sr
-----Original Message-----
Using VB.NET
---------------
Dim myString As String = "Hello World!"
Dim subString As String
subString = Microsoft.VisualBasic.Right(myString, 6) '
Returns "World!"
-----Original Message-----
How do you detect a string's right 3 charaters, say
string "abcde". I'd like to detect if the right three
charaters are "cde", then proceeding doing something.
Anyone know which method shall I use? Thanx.
.
.