What does sensors.getTempCByIndex(0) return? If it's a string you should be able to cast it in the same way as your test string.
If not is it a number (float?), does the second argument to client.sendto() have to be a uint8_t*? Can you cast from one to the other?
Do you need to cast it? I don't know whether the client.sendto() function and whatever is receiving it are in the library or written by you. If you've written them, you could modify them to accept the type of value returned by sensors.getTempCByIndex(0), then you wouldn't need a cast.
[EDIT (in response to the first two comments below)]I know that Arduino Sketches are a subset of C, but I'm not certain which bits of C work and which don't. There is a discussion here about casting a float (floating point number) to a string on the Arduino, but it appears to be saying that the method may be very memory intensive. A cast is basically when you change the type of a variable (eg float -> string), in C you typically do this by putting the new type in brackets immediately preceding the variable to change.
Looking at the code you've got:
client.sendto(11, (uint8_t*)"test\n", 6);
which appears to be casting the string "test\n" (typically called a string literal) to a uint8_t*, which appears to be a pointer to an 8 bit wide byte of data or possibly the first byte of an array of uint8_t bytes. This whole function call I'm guessing is converting the string into 6 bytes to transmit with 6 being the length of string.
Does the receiver automatically decode the message back to a string? The comments in the source code for your library appear to suggest that you can send any binary encoded data as the packet in your datagram/message, so rather than converting your existing float to a string you could convert the whole number part to an integer and send it, then take the first 2 or so digits of the decimal part and send them as an integer and then reconstruct the float at the far end.
At the bottom of this page there's mention of the standard C function itoa which is used to convert an integer (whole number) to an ascii string, if you can split your number into a whole number part and decimal part you can encode them using this as a string and concatenate them (computer programmer speak for join them together) into "wholenumberstring"+"."+"decimalstring" and then put the resulting string into client.sendto() making sure that the final argument to client.sendto() is the length of the newly formed string. It also tells you on that page what the overhead will be in terms of memory of using different implementations of itoa.
A further thought, how is your temperature data coming into the Arduino? Do you get a float, or do you actually get an analogue value (eg in the range 0 to 255 depending on the resolution) which is then converted to a decimal value. It might be easier to send the raw data as a string over the link and convert it at the other end.