473,326 Members | 2,023 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,326 software developers and data experts.

get every 2 parts of array

Im trying to get every 2nd part of my array() for example..

dim arr() as string
dim words as string

words = "Hello there, My Name Is Beaver"
arr() = split(words, " ")

i want to create a loop to get the words: "There, name beaver"

so its like every 2 parts of the array()

Thankyou
Jan 2 '09 #1
3 1866
set up a loop counter and test the loop variable using the modulus operator (%) with a value of 2. Suppose your loop variable is 'i'.

if (i % 2 ==0)
{
// this is every other element
}
Jan 2 '09 #2
This is visual basic?

Not javascript or java?
Jan 2 '09 #3
VB has a modulus operator. I think it is '%' as well.
Jan 2 '09 #4

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

Similar topics

0
by: Gary | last post by:
Hi, Given a regular formed html document, what would be the easiest way to grab 3 parts of the file? 1- everything from beginning of file up to and including the <body> tag 2- everything between...
3
by: src_mag | last post by:
Hello, I'd like to write JavaScript code that refreshes a frame once a second loading a different image each time. Basically, here's what the script would do: 0 sec load img0.gif 1 sec load...
5
by: Amil Hanish | last post by:
I have a huge byte array from another API that contains structs of differing sizes. I'd like to create n structs based on data in the byte array. But how? For example, if I want to take bytes...
30
by: Chaos | last post by:
As my first attempt to loop through every pixel of an image, I used for thisY in range(0, thisHeight): for thisX in range(0, thisWidth): #Actions here for Pixel thisX, thisY But it takes...
0
by: onno.willems | last post by:
Hi, In our project we have a large library of VB script (.vbs) files. Each file has 1 function. I want to document these functions, so a VB.NET application can retrieve the documentation and...
2
by: josh.23.french | last post by:
Does anyone have a regex (or knows how to make one) that will get the parts of an sql statement? $sql = "SELECT (* or 'id, username, etc') FROM `(tablename)`, " it should return the following...
8
by: bill | last post by:
Turning on error_reporting(E_ALL); was quite an eye opener as to how much "fixing" PHP will do for the sloppy coder. I fixed all of the errors except: Notice: Undefined property: parts in...
1
by: thomasc1020 | last post by:
This discussion is about VB.NET 2003. Suppose we received 300 bytes input from a serial port, which are numbered as B001, B002,..., B300. I want to save all 300 bytes and diplay only parts of...
1
by: Computernut234 | last post by:
Hi, i'm doing a project for my Java class and I know how to add text to a .txt document and remove the entire text but I do not know how to only remove certain parts of text. My code is supposed to...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

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.