VMware Cloud Community
MadMax1980
Contributor
Contributor
Jump to solution

Splitting output from a variable

Hi guys,

i searched little bit around, but i don't find the info ;( hoping somebody could help out Smiley Wink

for example:

if i have a variable which where i'am getting for example an ID like that:

0200080000600601603e642400b81bff7e0126df11524149442035

how could i manage this that the first 10 + the last 12 digits where removed.

thx

Max

Reply
0 Kudos
1 Solution

Accepted Solutions
LucD
Leadership
Leadership
Jump to solution

The String type has a method called SubString that you could use for that

$t = "0200080000600601603e642400b81bff7e0126df11524149442035"
$t.Substring(10,$t.Length - 12 -10)

The 2nd parameter indicates the length of the substring.

You take the toal length minus 10 and minus 12.

____________

Blog: LucD notes

Twitter: lucd22


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

View solution in original post

Reply
0 Kudos
2 Replies
LucD
Leadership
Leadership
Jump to solution

The String type has a method called SubString that you could use for that

$t = "0200080000600601603e642400b81bff7e0126df11524149442035"
$t.Substring(10,$t.Length - 12 -10)

The 2nd parameter indicates the length of the substring.

You take the toal length minus 10 and minus 12.

____________

Blog: LucD notes

Twitter: lucd22


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

Reply
0 Kudos
MadMax1980
Contributor
Contributor
Jump to solution

Hello there,

ah very nice, it's working.

Have many thx. ,)

Max

Reply
0 Kudos