hyTags
HomeHome DocumentationDocumentation

string-remove-prefix

Removes the prefix from a string if it matches.
Parameter
Type
Description
self
String
String to remove characters from
prefix
String
Prefix to remove
return
string
String with the prefix removed, or unchanged if prefix doesn't match
Test Case:Remove matching prefix
    <div></div>
    
    <string-new value="hello.txt">
    <string-remove-prefix prefix="hello">
    <assert-equal value=".txt" type="string">
    
    👆 Try to change something!
  • Test Case:Non-matching prefix returns unchanged
      <div></div>
      
      <string-new value="hello.txt">
      <string-remove-prefix prefix="bye">
      <assert-equal value="hello.txt" type="string">
      
      👆 Try to change something!
    • Test succeeded Test failed