about | help | code help+videos | done | prefs |
When you type your password, the characters are displayed as "*" instead of the actual characters you type. Write a method that converts any string into a string of the same length, but with each character replaced with "*". Spaces are NOT allowed in the string. If ANY spaces appear anywhere in the string, instead of returning a string of "*" characters, return a string "ERROR". test2021_02_25_APP1SLHL_passwordHide("Passwords cannot have spaces") → "ERROR" test2021_02_25_APP1SLHL_passwordHide("WhatGoodIsAPasswordWithout#1234") → "*******************************" test2021_02_25_APP1SLHL_passwordHide("drowssaP") → "********" ...Save, Compile, Run (ctrl-enter) |
Progress graphs:
Your progress graph for this problem
Random user progress graph for this problem
Random Epic Progress Graph
Difficulty: 220
Copyright Nick Parlante 2017 - privacy