can't we sort a string just like a classical sorting(bubble sort or something..) of an array?I tried. But it's not working.

```
string newstr = "dcba";
for(int i = 0; i < (newstr.size())-1; i++)
    {
        for(int k = i+1; k < newstr.size(); k++)
        {
            if(newstr[i] > newstr[k])
            {
                temp = newstr[i];
                newstr[k] = newstr[i];
                newstr[i] = temp;
            }
        }
    }

```