![]() ![]() I have scanned through the web a bit and the |trim and |replace or |regex options dont seem to do it. Here is what im trying to do to start stripping out spaces and other things like this but my solution doesnt remove the apostrophe and I dont want to keep creating more lines of code if there is a one-line jinja replace option I can use. New string with all instances strReplaceFrom replaced by strReplaceTo. strInputVal the string in which the special characters need to be replaced. They could add a ? or ! or any other special character. The following function will replace the special characters. When the user answers the vars prompt in ansible they can put whatever they want in the account name so I can't assume that they might only use the apostrophe( ' ). My example variable right now is: account_name: "my-laptops's DEV" My goal is to remove spaces with hyphens "-" and remove any special characters like the ' in laptop's in the user account name. Im trying to do some tricky things with a variable a user is inputting.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |