Curious on how to work with strings in NQE? This video covers the basics of working with the String datatype in NQE. Let us know what have you done with strings that made your co-workers say “How did you do that!” Post your queries or questions below
Code examples used in video
Return all devices where the first three characters of the device name is atl
foreach device in network.devices
where prefix(device.name, 3) == "atl"
select {
deviceName: device.name
}
Return all devices where the beginning of the device name is atl
foreach device in network.devices
where matches(device.name, "atl*")
select {
deviceName: device.name
}
Return all devices where the beginning of the device name is atl and contains the word spine
foreach device in network.devices
where matches(device.name, "atl*spine*")
select {
deviceName: device.name
}