pub struct Str;Implementations§
Source§impl Str
impl Str
Sourcepub fn of(value: &str) -> Stringable
pub fn of(value: &str) -> Stringable
Membuat instance baru stringable yang lancar (Str::of($value))
Sourcepub fn random(length: usize) -> String
pub fn random(length: usize) -> String
Menghasilkan string acak alfabet/angka dengan panjang tertentu (Str::random())
Sourcepub fn after(subject: &str, search: &str) -> String
pub fn after(subject: &str, search: &str) -> String
Get the portion of a string after the first occurrence of a given value
Sourcepub fn before(subject: &str, search: &str) -> String
pub fn before(subject: &str, search: &str) -> String
Get the portion of a string before the first occurrence of a given value
Sourcepub fn between(subject: &str, from: &str, to: &str) -> String
pub fn between(subject: &str, from: &str, to: &str) -> String
Get the portion of a string between two given values
Sourcepub fn contains(haystack: &str, needle: &str) -> bool
pub fn contains(haystack: &str, needle: &str) -> bool
Determine if a string contains another substring
Sourcepub fn starts_with(subject: &str, needle: &str) -> bool
pub fn starts_with(subject: &str, needle: &str) -> bool
Determine if a string starts with a given substring
Sourcepub fn ends_with(subject: &str, needle: &str) -> bool
pub fn ends_with(subject: &str, needle: &str) -> bool
Determine if a string ends with a given substring
Auto Trait Implementations§
impl Freeze for Str
impl RefUnwindSafe for Str
impl Send for Str
impl Sync for Str
impl Unpin for Str
impl UnsafeUnpin for Str
impl UnwindSafe for Str
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more