hyTags
HomeHome DocumentationDocumentation

string-remove-first

Removes N characters from the start of a string.
Parameter
Type
Description
self
String
String to remove characters from
length
Number?
Number of characters to remove from the start (default: 1)
return
string
String with first N characters removed
Test Case:Remove first 6 characters
    <div></div>
    
    <string-new value="hello world">
    <string-remove-first length="6">
    <assert-equal value="world" type="string">
    
    👆 Try to change something!
  • Test Case:Remove first character by default
      <div></div>
      
      <string-new value="hello">
      <string-remove-first>
      <assert-equal value="ello" type="string">
      
      👆 Try to change something!
    • Test Case:Remove more than string length returns empty
        <div></div>
        
        <string-new value="hi">
        <string-remove-first length="10">
        <assert-equal value type="string">
        
        👆 Try to change something!
      • Test succeeded Test failed