As far as I know it depends on the program and location I think. I recommend to check out this article https://addictionresource.com/drug-rehab/inpatient-rehabs/ and be sure that you have all required information in order to take a clear decision. You see, the best you can do is be armed with info. Hope it can help.
@Luv2Lik Obviously i would say yes,for that kind of drug.I used to masturbate on
a daily basis(kinda addicted to it).Though I felt that it was affecting my student life(i could'nt concentrate on my studies and also had difficulty in memorising)still i could'nt control it.Becoz of it i screwed my high school exam two years ago and unfortunately ended up studying in a tier 3 college.However somehow,now i am able to bring it down to two to three times a week.i usually did it to get rid of depression.So i took up smoking which simultaneously helps me to curb my depression and keep a check on masturbation.