The same 18V battery that comes with your trimmer can be used with an 18V Ryobi power drill if it's part of the ONE+ line, so there's a lot of value there. To use an example, the Ryobi 18V 10-inch ...
so remove all the parts carefully. If you want to just replace the existing empty spool with one that's preloaded with a trimmer line, make sure the spool matches the Ryobi trimmer model you have.