Link to home
Start Free TrialLog in
Avatar of Skale
Skale

asked on

Checking System.Array's item's naming in vb.net

Hi, I'm using below COM-interface function to get a list of used parameters in 3rd part program. Function output type is System.Array and item's like below;

model.getParameterList()

Open in new window

Sample Output of model.getParameterList() as System.Array:
$X_FR_TABUl_F_x
$X_FR_TABUl_F_y
$X_FR_TABUl_F_z
$X_FR_FABUl_M_x
$X_FR_FABUl_M_y
$X_FR_FABUl_M_z
$X_FR_FADAl_F_x
$X_FR_FADAl_F_y
$X_FR_FADAl_F_z
$X_FR_FADAl_M_x
$X_FR_FADAl_M_a
$X_FR_FADAl_M_z


As in example F_x, F_y, F_z, M_x, M_y, M_z is related to each other so i'd like to check (e.g.) item starting with "$X_FR_TABUl" has F_x, F_y, F_z, M_x, M_y, M_z items. If all of them is existing it will return True else it will return False for each item.

$X_FR_TABUl -- TRUE
$X_FR_FADAl -- FALSE

Because as you can see $X_FR_FADAl_M_y is it missing.

Is there anyway to quick check these naming with best approach (maybe with LINQ) in vb.net ?

Any help would be grateful. Thanks.
ASKER CERTIFIED SOLUTION
Avatar of ste5an
ste5an
Flag of Germany image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Skale
Skale

ASKER

Thanks ste5an that's what i am looking for, but could you please show me how can , it looks F's as a one group and M's are one group. I'm looking for the F_x, F_y_ F_z, M_x, M_y,_ M_z as one group so i expected;

            Console.WriteLine(r.Key + " " + r.Count.ToString())
 
r.count.tostring //output will be 6.
Just change the value in the group by function from 3 to 1.
Avatar of Skale

ASKER

Thanks for the information how can i check single value with your code like $X_FR_TABUl_F_x ?