Register | Login | |||||
Main
| Memberlist
| Active users
| Calendar
| Chat
| Online users Ranks | FAQ | ACS | Stats | Color Chart | Search | Photo album |
| |
0 users currently in Programming. |
User | Post |
Sukasa Posts: 778/2068 |
Here, I placed kawa's code into a function for you to use.
That should work for you. |
Kyoufu Kawa Posts: 648/1353 |
...but either way, to split using VB6's indeed (and I too think they could be better), use...
firstHalf = Left(fullString, Len(fullString) / 2) secondHalf = Right(fullString, Len(fullString / 2) Might need a +1 or -1 somewhere. |
Parasyte + Posts: 46/53 |
If this is for splitting hexadecimal bytes into nybbles, as it appears to be, you are better off using math:
results(1) = number / 16 results(2) = number Mod 16 |
Dan Posts: 113/219 |
The functions you are looking for are the Left function, the Right function, and probably also the Len function.
I'd actually forgotten how poor VB's string support actually is. |
dcahrakos Posts: 346/499 |
I know you can use the split function to split strings into an array, but im not sure if you can use split to actually half the string without some delimiter, such as a space, or any other letter or symbol right at the halfway point of the string...so if you did want it like that you could do:
dim arry() as string arry = Split (strng, " "), but that will split the string at every space, you can change the delimiter to whatever, but I dont think split can do halves, ill look for a specific function for you though. |
Arthus Posts: 54/142 |
I can't seem to locate a function that can let me half a string. When I tried to make one, I couldn't find anything that would remotly help me in doing so. So does anyone have a function that would let me turn a string into an array.
Example: String = "AE" after putting this string through the function: hlaf("AE") the array would come as follows: results = Array( 1 => "A" 2 => "E" ) Or something along those lines. |