What happend to Right & Left
What happend to Right & Left
Hi everyone
I just tried to manipulate some strings in VB.Net, but what happend to Left() and Right() and of course Mid(). It seems that these functions are gone, but which one can I use Or is there now a totaly diffrent concept behind i Thanks for some advices. .
What happend to Right & Left
FrancoA
Andrew Jacobs
Left and Right are gone, but there are some new methods & functions wich are very helpful. There is first Substring(). But also :
LastIndexOf() or Index() or Length() etc.
Now you have to use them for getting the needed parameters to fill in the Substring(), if you don't have a fix lenght that you can use.
So all you VB6 ! Learn to love the .Net Framework!
JamesMiles
namespacemodule (sorry):Strings.Left("Zac", 1)
Here's a pic.
Flavio
joe_pool_is
Dim myString As String = "Hello World"
Dim newSring As String
newString = myString.SubString(0,5)
Debug.WriteLine(newString)
newString = myString.Substring(6,5)
Debug.WriteLine(newString)
newString = myString.SubString(myString.Length - 2)
Debug.WriteLine(newString)
You should have the following output:
"Hello"
"World"
"ld"
Good Luck.
Webbtrad
http://msdn2.microsoft.com/en-us/library/05e63829.aspx.
Should this have ref. to use of String.Substring
Rschraeger
It's all in the Link I gave you above.
By the way Zac - No Pic.
Mang
Microsoft.VisualBasic.Left(STRING, INTEGER)
String is the string variable that you want to reference and Int in the amount of chars that you need to show.
Hope that helps. Im a newbie. :)
Winnipeg B
LEN$ is also available.