str

This is the string type of ThingsDB. A value of type str should contain valid UTF-8 characters. This is not guaranteed but rather depends on MessagePack to pack data correctly. There is an isutf8 which can be used to test a str value for valid UTF-8 data and it is also possible to create an utf8 property on a custom Type which only allows strings with valid UTF-8 data.

Methods

Method Description
contains Determines if a given string is a substring of a string.
endswith Determines if a string ends with characters given by another string.
len Returns the length of a string.
lower Return a new string in which all case-based characters are in lower case.
startswith Determines if a string starts with characters given by another string.
test Test if a string matches a given regular expression and return true or false.
upper Return a new string in which all case-based characters are in upper case.

This code creates a raw property greet to collection stuff:

.greet = 'Hello world!!';