&& is a conditional AND operator.
You can use the + operator to concatenate strings, but it is not recommended to use this in a loop (more) .
Use either StringBuilder :
StringBuilder builder = new StringBuilder(299 * 4); // Or whatever for (int i = 0; i < 299; i += 2) { builder.Append(IntToHex(buffer[i])); } string combined = builder.ToString();
Or potentially use string.Join - it may not be so practical in this case, considering your loop, but in other cases it would be great. You can still use it here, for example:
string combined = string.Join("", Enumerable.Range(0, 149) .Select(i => IntToHex(buffer[i * 2])));
source share