Skip to main content
Beginner

NQE - Using String Data Type

  • September 13, 2023
  • 0 replies
  • 233 views

Mike
Community Manager
  • Community Manager

 

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
}