for example, can i do this:
split = temp_string.Split("<beginning of record>")
those of you recommended:
split = Regex.Split(temp_string, "< beginning of record >")
its not working. its just returning the first char "<"
and those of you that recommended:
Dim myDelims As String() = New String(){"< beginning of record >"} split = temp_string.Split(myDelims, StringSplitOptions.None)
this is not working either. it's also returning just the first char
The split() method splits a string into an array of substrings. The split() method returns the new array. The split() method does not change the original string. If (" ") is used as separator, the string is split between words.
Try Mid(txtCpu. Text, Len(txtCpu. Text) - 6, 3) - the last parameter is the length of the string you want, not an absolute position.
Python String split() MethodThe split() method splits a string into a list. You can specify the separator, default separator is any whitespace. Note: When maxsplit is specified, the list will contain the specified number of elements plus one.
Try this:
string[] myDelims = new string[] { "<beginning of record>" }; split = temp_string.Split(myDelims,StringSplitOptions.None);
Running this through a code converter results in this:
Dim myDelims As String() = New String() { "<beginning of record>" } split = temp_string.Split(myDelims, StringSplitOptions.None)
You may also need to escape the chevrons, like this:
"\< beginning of record \>"
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With