Question Locked

VB script

0 helpful
2 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

Hi

I have a string
String s1 = "IP>10.10.1.1 and IP<10.10.1.10";
String s2 = "10.10.1.7";

how to write a VB script to search my string s2 is in the range of s1.

as i am completely new to VB please help me out in solving my problem.

2 replies

by tony hopkinson

First thing to do is rationalise s1
s1min = "10.10.1.1"
s1Max = "10.10.1.10"

Then you need to use the split function

IPMin = Split(s1Min,".")

Will give you and array of strings "10", "10","1","1"

So after you've split the others it's just a a lot of if statements
if IPS2{0) >= IPMin(0)....

This discussion is closed to new replies.