How do I escape spaces in path for scp copy in Linux?

Basically you need to escape it twice, because it’s escaped locally and then on the remote end. There are a couple of options you can do (in bash): scp user@example.com:”‘web/tmp/Master File 18 10 13.xls'” . scp user@example.com:”web/tmp/Master\ File\ 18\ 10\ 13.xls” . scp user@example.com:web/tmp/Master\\\ File\\\ 18\\\ 10\\\ 13.xls .

Split by comma and strip whitespace in Python

Use list comprehension — simpler, and just as easy to read as a for loop. my_string = “blah, lots , of , spaces, here ” result = [x.strip() for x in my_string.split(‘,’)] # result is [“blah”, “lots”, “of”, “spaces”, “here”] See: Python docs on List Comprehension A good 2 second explanation of list comprehension.

Efficient way to remove ALL whitespace from String?

This is fastest way I know of, even though you said you didn’t want to use regular expressions: Regex.Replace(XML, @”\s+”, “”); Crediting @hypehuman in the comments, if you plan to do this more than once, create and store a Regex instance. This will save the overhead of constructing it every time, which is more expensive … Read more

How to split a string with any whitespace chars as delimiters

Something in the lines of myString.split(“\\s+”); This groups all white spaces as a delimiter. So if I have the string: “Hello[space character][tab character]World” This should yield the strings “Hello” and “World” and omit the empty space between the [space] and the [tab]. As VonC pointed out, the backslash should be escaped, because Java would first … Read more

Show whitespace characters in Visual Studio Code

VS Code 1.6.0 and Greater As mentioned by aloisdg below, editor.renderWhitespace is now an enum taking either none, boundary or all. To view all whitespaces: “editor.renderWhitespace”: “all”, Before VS Code 1.6.0 Before 1.6.0, you had to set editor.renderWhitespace to true: “editor.renderWhitespace”: true

Removing whitespace from strings in Java

st.replaceAll(“\\s+”,””) removes all whitespaces and non-visible characters (e.g., tab, \n). st.replaceAll(“\\s+”,””) and st.replaceAll(“\\s”,””) produce the same result. The second regex is 20% faster than the first one, but as the number consecutive spaces increases, the first one performs better than the second one. Assign the value to a variable, if not used directly: st = … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)