Using SPST switch as digital input?
Yes it would work as you described. That is called a pull-down resistor because it assures that when the contact is open the digital input is at the logic state 0 (low). Usually you can use a 10 KΩ resistor for this purpose.