Question

Locked

VB script

By 2rajesh.b ·
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.

This conversation is currently closed to new comments.

2 total posts (Page 1 of 1)  
| Thread display: Collapse - | Expand +

All Answers

Collapse -

Well you've made this difficult for yourself

by Tony Hopkinson In reply to VB script

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)....

Back to Web Development Forum
2 total posts (Page 1 of 1)  

Software Forums