I've got a number of places in files for a project with the following format: func whatever() ->Bool {. However, it looks like the standard Swift guide is to use func nevermind() -> String (note the space between the -> and the start of the return type).

I am able to find all these instances by using Regular Expression option in the Replace sidebar with ->[^ ]. However, this includes the first character of the return type. What should I type in the replace field to insert a space without bothering the next non-space character?

  • 1
    Something like this is better suited for Stack Overflow, even though it's about app development for Apple products. You'll get better answers there. – RedEagle2000 Dec 8 '15 at 4:25
  • Any good way to copy this over to there without having to markup the formatting again? (I realised I could brute-force my way by matching all instances of -> and replacing them with -> , then matching any -> to catch the ones that over-corrected). – cjm Dec 8 '15 at 5:43

You must log in to answer this question.

Browse other questions tagged .