pub type Il2CppString = Il2CppObject<SystemString>;
Expand description
A type alias for Il2CppObject<SystemString>
.
Represents a C# string used by Il2Cpp.
Aliased Type§
struct Il2CppString {
pub klass: &'static mut Il2CppClass,
pub fields: SystemString,
/* private fields */
}
Fields§
§klass: &'static mut Il2CppClass
The class this instance refers to.
Be aware that editing it means editing every other object using the same class.
Use carefully.
fields: SystemString
Implementations§
source§impl Il2CppString
impl Il2CppString
sourcepub fn new<'a>(string: impl AsRef<str>) -> &'a Il2CppString
pub fn new<'a>(string: impl AsRef<str>) -> &'a Il2CppString
Create a new instance of a SystemString using the provided value.
Internally turned into a CString
, so make sure the provided value is a valid UTF-8 string.
Example:
let string = Il2CppString::new("A new string");
```j
pub fn new_static(string: impl AsRef<str>) -> &'static mut Il2CppString
pub fn get_string(&self) -> Result<String, FromUtf16Error>
👎Deprecated: Use Il2CppString::to_string instead
pub fn to_string(&self) -> String
pub fn to_lowercase(&self) -> &mut Il2CppString
pub fn starts_with<'a>(&self, value: impl Into<&'a Il2CppString>) -> bool
pub fn contains<'a>(&self, value: impl Into<&'a Il2CppString>) -> bool
pub fn replace<'a>( &mut self, old_value: impl Into<&'a Il2CppString>, new_value: impl Into<&'a Il2CppString>, ) -> &mut Il2CppString
sourcepub fn clone(&self) -> &Il2CppString
pub fn clone(&self) -> &Il2CppString
Provides a new instance of the Il2CppString, separate from the original.