Question: So I have an array and I know how to find the highest value but I can't figure out how to obtain the position of that value in the array. The method so far is as follows:

```
 public static void findHottest(int[] temp){
        int hottest = temp[0];
        for(int i = 1; i < temp.length; i++){
            if(temp[i] > hottest) {
                hottest = temp[i];
            }
        }

```

Answer: 
You could use [Regex](http://msdn.microsoft.com/en-us/library/system.text.regularexpressions.regex%28v=vs.110%29.aspx):

```
var myText = @"this is my text more text texttext and here comes something special [S p e c i a l string] more random text";
var pattern = @"\s+(?![^\[]*\])";
var output = new Regex(pattern).Replace(myText, "");

```

output will hold:

```
thisismytextmoretexttexttextandherecomessomethingspecial[S p e c i a l string]morerandomtext

```
you could do something like 

```
stringbuilder sb = new stringbuilder();
bool should_remove = true;

foreach (var c in my_string) {
    if (c == your_start_special_char)
        should_remove = false;
    else if (c == your_end_special_char)
        should_remove = true;   
    else if (c != ' ')
       sb.append(c);
}

```

mind the upper cases and syntax ... not on VS atm ...

Another option would be to splice it depending on your special areas and remove spaces from the regular ones ...