473,387 Members | 1,520 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Split settings

Hello... I have a question about Split function:
I need to split text ("ABCDEFGH") in letters.. and what I have to write in "Delimiter of string"??
for e.g.
Expand|Select|Wrap|Line Numbers
  1. Split("ABCDEFGH", "", 1)
isn't working. :(

PS.: Sorry about my english.
Nov 23 '06 #1
5 2009
I found out:
Expand|Select|Wrap|Line Numbers
  1. variable.Substring(i, 1)
But now is another problem... How can i add this value to array?
e.g.
my_array(i) = variable.Substring(i, 1)

can I put "i" in array value id?
Nov 23 '06 #2
As far as i know it would have to be my_array(0) = variable.Substring(i, 1) , A number not i
Nov 23 '06 #3
albertw
267 100+
As far as i know it would have to be my_array(0) = variable.Substring(i, 1) , A number not i
hi

suppose your string strValue holds "2,e,f,5,6,h,u"

then

array=split(strValue,",") 2nd argument is delimiter

first item of the array will be array(0), value 2 etc
Nov 24 '06 #4
Killer42
8,435 Expert 8TB
I found out:
variable.Substring(i, 1)
But now is another problem... How can i add this value to array?
e.g.
my_array(i) = variable.Substring(i, 1)
can I put "i" in array value id?
What you need to do is write a loop to go through one character at a time. Something along these lines...
Expand|Select|Wrap|Line Numbers
  1. S = "ABCDEFGH"
  2. For i = 1 To Len(S)
  3.   my_array(i) = Mid(S, i, 1)
  4. Next
However, this is VB6 code. From the Substring you've used, I suspect you're using VB.Net. They are similar in some ways, different in others. The same sort of logic should apply here though - loop through the characters, placing them into the array elements.

As albertw pointed out, to use Split there has to be some delimiter character in the string, on which to split. Such as spaces between words, or commas netween data fields, etc.
Nov 24 '06 #5
willakawill
1,646 1GB
I found out:
Expand|Select|Wrap|Line Numbers
  1. variable.Substring(i, 1)
But now is another problem... How can i add this value to array?
e.g.
my_array(i) = variable.Substring(i, 1)

can I put "i" in array value id?
Hi. Try this;
Expand|Select|Wrap|Line Numbers
  1. Dim ar() As String
  2. Dim MyString As String
  3. Dim i As Integer
  4.  
  5. MyString = "ABCDEFGHIJK"
  6. ReDim ar(Len(MyString) - 1)
  7.  
  8. For i = 0 To UBound(ar)
  9.    ar(i) = MyString.Substring(i + 1, 1)
  10. Next i
  11.  
Nov 24 '06 #6

Sign in to post your reply or Sign up for a free account.

Similar topics

5
by: Stu Cazzo | last post by:
I have the following: String myStringArray; String myString = "98 99 100"; I want to split up myString and put it into myStringArray. If I use this: myStringArray = myString.split(" "); it...
9
by: Will McGugan | last post by:
Hi, I'm curious about the behaviour of the str.split() when applied to empty strings. "".split() returns an empty list, however.. "".split("*") returns a list containing one empty string. ...
13
by: Larry L | last post by:
Access is noted for bloating a database when you add and delete records frequently. I have always had mine set to compact on close, and that works great. Now after everyone's advice I split my...
4
by: Itzik | last post by:
can i split this string string str = "aa a - bb-b - ccc" with this delimiter string del = " - " i want recieve 3 items : "aa a" , "bb-b" , "ccc"
14
by: Ron | last post by:
Hello, I am trying to parse a string on the newline char. I guess vbCrLf is a string constant. How can I parse my string - data - on the newline char? .... data += ASCII.GetString(buffer, 0,...
3
by: Ben | last post by:
Hi I am creating a dynamic function to return a two dimensional array from a delimeted string. The delimited string is like: field1...field2...field3... field1...field2...field3......
5
by: kurt sune | last post by:
The code: Dim aLine As String = "cat" & vbNewLine & "dog" & vbNewLine & "fox" & vbNewLine Dim csvColumns1 As String() = aLine.Split(vbNewLine, vbCr, vbLf) Dim csvColumns2 As String() =...
19
by: Mark 123 | last post by:
I just read at http://groups.google.com/group/microsoft.public.access.forms/browse_frm/thread/766ba7b493eacb63/8a7d5504ee848c21?lnk=st&q=migrate+access+97+to+access+2007&rnum=1#8a7d5504ee848c21...
2
by: Lars | last post by:
Hi I got some programming experience and I recently started looking into Python. I've read much of the tutorial from 2.6 documentation. But it was more interesting to get started on something I...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.