mirror of
https://github.com/fluencelabs/wasm-bindgen
synced 2025-06-18 07:21:24 +00:00
String - substr() support
This commit is contained in:
@ -340,6 +340,14 @@ extern {
|
||||
/// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/slice
|
||||
#[wasm_bindgen(method, js_class = "String")]
|
||||
pub fn slice(this: &JsString, start: u32, end: u32) -> JsString;
|
||||
|
||||
/// The substr() method returns the part of a string between
|
||||
/// the start index and a number of characters after it.
|
||||
///
|
||||
/// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/substr
|
||||
/// TODO: Add `NaN` and `undefined` support
|
||||
#[wasm_bindgen(method, js_class = "String")]
|
||||
pub fn substr(this: &JsString, start: i32, length: i32) -> JsString;
|
||||
}
|
||||
|
||||
impl<'a> From<&'a str> for JsString {
|
||||
|
Reference in New Issue
Block a user