Laptop battery

Will my laptop work if I remove the battery but still have the laptop plugged in? Someone suggested to me that if I have it plugged in most of the time, I could extend my battery’s life by not using it.