7 kyu
Hide password from jdbc url
459 of 929Javatlacati
Description:
We have to create a function that receives a connection string with password included and you have to mask the password i.e. change password by asterisks.
Preconditions:
- non empty valid url
- password always next to string section
password=
- assume password will not contain ampersand sign for sake of simplicity
- to make it more real it has non ASCII characters
- "password=" and "user" will occur only once
empty passwords are not validated but best solutions take empty passwords into account
Example:
input
jdbc:mysql://sdasdasdasd:szdasdasd:dfsdfsdfsdf/sdfsdfsdf?user=root&password=12345
output
jdbc:mysql://sdasdasdasd:szdasdasd:dfsdfsdfsdf/sdfsdfsdf?user=root&password=*****
Extra readings:
https://alvinalexander.com/java/jdbc-connection-string-mysql-postgresql-sqlserver
Strings
Regular Expressions
Fundamentals
Similar Kata:
Stats:
Created | Feb 1, 2018 |
Published | Feb 7, 2018 |
Warriors Trained | 1917 |
Total Skips | 90 |
Total Code Submissions | 8133 |
Total Times Completed | 929 |
JavaScript Completions | 459 |
CoffeeScript Completions | 10 |
Java Completions | 270 |
Kotlin Completions | 213 |
Total Stars | 34 |
% of votes with a positive feedback rating | 90% of 245 |
Total "Very Satisfied" Votes | 205 |
Total "Somewhat Satisfied" Votes | 33 |
Total "Not Satisfied" Votes | 7 |
Total Rank Assessments | 6 |
Average Assessed Rank | 7 kyu |
Highest Assessed Rank | 6 kyu |
Lowest Assessed Rank | 8 kyu |