I’m having a lot of trouble with this and I can’t seem to figure out exactly how to do what is being asked, any help at all would be great:
8.6.1. String Modification
Use string methods to convert a word into pseudo-pig latin.
1. Remove the first three characters from a string and add them to the end. Ex:
'nchCodeLau'. Use a template literal to print the original and modified string in a descriptive phrase.
2. Modify your code to accept user input. Query the user to enter the number of letters that will be relocated.
3. Add validation to your code to deal with user inputs that are longer than the word. In such cases, default to moving 3 characters. Also, the template literal should note the error.
#1. is what I’m not sure how to do. Is it asking us to do this in 1 line since strings are immutable? If so what method to use? Are we method chaining to make it work?
#2 & # 3 I know I will run into trouble. Just hoping someone here has done this before or recognizes what they mean and can help me out…thanks