7 kyu
Manipulate URL Parameters
716 of 739AKJ.IO
Description:
You need to write a function ( addOrChangeUrlParameter(url, keyValueParameter)
) that can manipulate URL parameters.
It should be able to
- add a parameter to an existing URL,
but also to
- change a parameter if it already exists.
Example:
addOrChangeUrlParameter("www.example.com", "key=value")
// -> 'www.example.com?key=value' (adds a parameter).
addOrChangeUrlParameter("www.example.com?key=value", "key2=value2" )
// -> 'www.example.com?key=value&key2=value2' (adds another parameter).
addOrChangeUrlParameter("www.example.com?key=oldValue`", "key=newValue" )
// ->'www.example.com?key=newValue' (changes the parameter).
Strings
Parsing
Regular Expressions
Fundamentals
Similar Kata:
Stats:
Created | Sep 25, 2013 |
Published | Sep 26, 2013 |
Warriors Trained | 2548 |
Total Skips | 919 |
Total Code Submissions | 11196 |
Total Times Completed | 739 |
JavaScript Completions | 716 |
CoffeeScript Completions | 32 |
Total Stars | 49 |
% of votes with a positive feedback rating | 82% of 191 |
Total "Very Satisfied" Votes | 144 |
Total "Somewhat Satisfied" Votes | 27 |
Total "Not Satisfied" Votes | 20 |
Total Rank Assessments | 78 |
Average Assessed Rank | 6 kyu |
Highest Assessed Rank | 4 kyu |
Lowest Assessed Rank | 7 kyu |