In this study, water-soluble carbon dots (B-CDs) were synthesized from the peel of red pitaya fruits.The synthesized B-CDs were characterized and recognized by optical, microscopical, and spectroscopical techniques.In addition, the quantum yield of the prepared B-CDs was determinedThe prepared B-CDs exhibit distinctive fluorescence spectra at 369.5 nm and 441.5 nm for excitation and emission, resp.On the other hand, lornoxicam exhibits a UV-absorbance spectrum with the highest peak of 370 nm, which thoroughly overlapped with fluorescence excitation of the prepared B-CDs and competed with its absorption.Consequently, the fluorescence of the prepared B-CDs was quenched, and a novel fluorescence anal. method was developed to determine lornoxicam based on the primary inner filter effect mechanism.The validation of the method exhibited a linearity of 1.5-12.0 μg/mL with a detection limit of 0.405 μg/mL in addition to satisfactory recovery and accuracy.The study has effectively measured the amount of lornoxicam in different types of pharmaceutical dosage forms.Moreover, to ensure environmental sustainability, greener solvents were chosen in place of hazardous solvents, utilizing the Green Solvents Selecting Tool.Anal. Eco scale, NEMI, AGREE and Agree prep algorithms, SPMS, and Complex-GAPI, as well as an extensive greenness anal., proved the technique′s advantageous ecol. characteristics.In addition, the recent RGB12 and BAGI algorithms were applied to evaluate the greenness framework and were introduced as tools for examining the "whiteness" and "blueness" of the work.