Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SHELL

bash #Complete the function/method so that it returns the url with anything after the anchor (#) removed.

#!/bin/bash

exclude() {
    # value stores $1 argument passed to exclude() function
    value=$1
    echo "$value" | cut -f1 -d"#"
}

exclude www.codewars.com#about
 
PREVIOUS NEXT
Tagged: #bash #returns #url #anchor
ADD COMMENT
Topic
Name
3+6 =