Struct cxx_qt_lib::QString
source · #[repr(C)]pub struct QString { /* private fields */ }
Expand description
The QString class provides a Unicode character string.
Note that QString is a UTF-16 whereas Rust strings are a UTF-8
Implementations§
source§impl QString
impl QString
sourcepub fn contains(&self, str: &QString, cs: CaseSensitivity) -> bool
pub fn contains(&self, str: &QString, cs: CaseSensitivity) -> bool
Returns true if this string contains an occurrence of the string str; otherwise returns false.
source§impl QString
impl QString
sourcepub fn ends_with(&self, s: &QString, cs: CaseSensitivity) -> bool
pub fn ends_with(&self, s: &QString, cs: CaseSensitivity) -> bool
Returns true if the string ends with s; otherwise returns false.
source§impl QString
impl QString
sourcepub fn is_right_to_left(&self) -> bool
pub fn is_right_to_left(&self) -> bool
Returns true if the string is read right to left.
source§impl<'a> QString
impl<'a> QString
sourcepub fn remove(
&'a mut self,
str: &QString,
cs: CaseSensitivity
) -> &'a mut QString
pub fn remove( &'a mut self, str: &QString, cs: CaseSensitivity ) -> &'a mut QString
Removes every occurrence of the given str string in this string, and returns a reference to this string.
source§impl QString
impl QString
sourcepub fn starts_with(&self, s: &QString, cs: CaseSensitivity) -> bool
pub fn starts_with(&self, s: &QString, cs: CaseSensitivity) -> bool
Returns true if the string starts with s; otherwise returns false.
source§impl QString
impl QString
sourcepub fn arg(&self, a: &QString) -> Self
pub fn arg(&self, a: &QString) -> Self
Returns a copy of this string with the lowest numbered place marker replaced by string a, i.e., %1, %2, …, %99.
sourcepub fn compare(&self, other: &QString, cs: CaseSensitivity) -> Ordering
pub fn compare(&self, other: &QString, cs: CaseSensitivity) -> Ordering
Lexically compares this string with the other string and returns if this string is less than, equal to, or greater than the other string.
sourcepub fn index_of(&self, str: &QString, from: isize, cs: CaseSensitivity) -> isize
pub fn index_of(&self, str: &QString, from: isize, cs: CaseSensitivity) -> isize
Returns the index position of the first occurrence of the string str in this string, searching forward from index position from. Returns -1 if str is not found.
sourcepub fn insert<'a>(&'a mut self, pos: isize, str: &Self) -> &'a mut Self
pub fn insert<'a>(&'a mut self, pos: isize, str: &Self) -> &'a mut Self
Inserts the string str at the given index position and returns a mutable reference to this string.
sourcepub fn left(&self, n: isize) -> Self
pub fn left(&self, n: isize) -> Self
Returns a substring that contains the n leftmost characters of the string.
sourcepub fn mid(&self, position: isize, n: isize) -> Self
pub fn mid(&self, position: isize, n: isize) -> Self
Returns a string that contains n characters of this string, starting at the specified position index.
sourcepub fn right(&self, n: isize) -> Self
pub fn right(&self, n: isize) -> Self
Returns a substring that contains the n rightmost characters of the string.
sourcepub fn simplified(&self) -> Self
pub fn simplified(&self) -> Self
Returns a string that has whitespace removed from the start and the end, and that has each sequence of internal whitespace replaced with a single space.
sourcepub fn split(
&self,
sep: &QString,
behavior: SplitBehaviorFlags,
cs: CaseSensitivity
) -> QStringList
pub fn split( &self, sep: &QString, behavior: SplitBehaviorFlags, cs: CaseSensitivity ) -> QStringList
Splits the string into substrings wherever sep occurs, and returns the list of those strings. If sep does not match anywhere in the string, split() returns a single-element list containing this string.
sourcepub fn to_latin1(&self) -> QByteArray
pub fn to_latin1(&self) -> QByteArray
Returns a Latin-1 representation of the string as a QByteArray.
sourcepub fn to_local8bit(&self) -> QByteArray
pub fn to_local8bit(&self) -> QByteArray
Returns the local 8-bit representation of the string as a QByteArray. The returned byte array is undefined if the string contains characters not supported by the local 8-bit encoding.
sourcepub fn to_utf8(&self) -> QByteArray
pub fn to_utf8(&self) -> QByteArray
Returns a UTF-8 representation of the string as a QByteArray.
Trait Implementations§
source§impl Clone for QString
impl Clone for QString
source§fn clone(&self) -> Self
fn clone(&self) -> Self
Constructs a copy of other.
This operation takes constant time, because QString is implicitly shared. This makes returning a QString from a function very fast. If a shared instance is modified, it will be copied (copy-on-write), and that takes linear time.
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl ExternType for QString
impl ExternType for QString
source§impl From<&QString> for QStringList
impl From<&QString> for QStringList
source§impl Ord for QString
impl Ord for QString
source§impl PartialEq for QString
impl PartialEq for QString
source§impl PartialOrd for QString
impl PartialOrd for QString
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
self
and other
) and is used by the <=
operator. Read more