How to extract part of a string
-
I am calling "GetVolumeInformation" to get hold of drive volume label. The 2nd parameter of this function is declared as Dim driveLabel As String = Space(200) This string remains 200 in length even though the label returned is only 11 chars long, say "MY PROJECTS " This string delaration is giving me a lot of trouble and it completely messes up the rest of my code when I concat it with other string variables. (eg dim myText = " label is " & drivelabel). Everything become 200 in length. Does anyone know how I can extract the useful part of "driveLabel" as declared above??? That is a string with the correct "string.length" value (for "MY PROJECT " I need driveLabel.length=10)
-
I am calling "GetVolumeInformation" to get hold of drive volume label. The 2nd parameter of this function is declared as Dim driveLabel As String = Space(200) This string remains 200 in length even though the label returned is only 11 chars long, say "MY PROJECTS " This string delaration is giving me a lot of trouble and it completely messes up the rest of my code when I concat it with other string variables. (eg dim myText = " label is " & drivelabel). Everything become 200 in length. Does anyone know how I can extract the useful part of "driveLabel" as declared above??? That is a string with the correct "string.length" value (for "MY PROJECT " I need driveLabel.length=10)