I left my over 18 year old in jail twice. I never imagined leaving a child in a place like that could ever be a good thing- nor did I think _I_ could ever allow it.
The first time, when he was 18, he spent a month there and was transferred into the custody of a local halfway house. He had probation after that. I came very close to bailing him out that time and am so glad I didn't.
This last time my son actually chose to attend a drug rehab program _in_ jail...a boot camp experience that actually required he spend a longer/tougher time incarcerated. (almost a year) He completed it, attended the next phase facility of his own choice and is now- this week- on his own for the first time in his life. I've never seen him more serious about changing the course of his life.
I hope that your daughter will get the treatment she needs and learn from this experience.