Gear-inches = (chainring teeth/cog teeth)*wheel diameter. For both 27" and 700c wheels, the usual wheel diameter value used is 27.
In your example a 42/22 would be (42/22)*27 = 51.5 gear-inches and a 35/18 would be (35/18)*27 = 52.5 gear-iches so the difference is about 2% which is negligable.
You can use this equation for any gear combination you are interested in comparing.