vtkmodules.util.string_array#

Pythonic interface for vtkStringArray.

Makes vtkStringArray behave like a Python list of strings::

arr = vtkStringArray()
arr.append("hello")           # InsertNextValue
arr.extend(["a", "b", "c"])   # InsertNextValue loop
len(arr)                      # 4
arr[0]                        # "hello"
arr[-1]                       # "c"
arr[1] = "world"              # SetValue
"hello" in arr                # True
list(arr)                     # ["hello", "world", "b", "c"]
repr(arr)                     # vtkStringArray(['hello', 'world', 'b', 'c'])

Module Contents#

Classes#

API#

class vtkmodules.util.string_array._StringArrayMixin(*args, **kwargs)#

Initialization

_init_from_data(data)#

Populate the array from an iterable of strings.

__len__()#
__getitem__(index)#
__setitem__(index, value)#
__contains__(value)#
__iter__()#
__repr__()#
append(value)#

Append a string to the end of the array.

extend(iterable)#

Extend the array with strings from an iterable.

clear()#

Remove all strings from the array.

class vtkmodules.util.string_array.StringArray(*args, **kwargs)#

Bases: vtkmodules.util.string_array._StringArrayMixin, vtkmodules.vtkCommonCore.vtkStringArray

Initialization