**1. Introduction**

Analytical chemistry focused on the development of methods for the qualitative and quantitative determination of compounds with di fferent chemical structures is a huge, dynamically developing field of science. The number of available methods and techniques is impressive. However, in addition to successes, there are many limitations regarding the use of such approaches. Problems may appear already at the sample preparation stage. Inadequate selectivity, and the use of large volumes of harmful organic solvents with a high vapor pressure in liquid-liquid extraction (LLE) or solid-phase extraction (SPE) are some of the many reasons for the search for alternatives [1]. The introduction of microextraction combined with the reduction of organic solvents used, and the inclusion of additional physical and chemical factors (sonication, temperature) have brought enormous progress, but also

have several di fficulties. Microextraction into both solid and liquid phases is a time-consuming process, and the final results require the indication of many other conditions [2]. For example, in solid-phase microextraction (SPME), commercially available fibers are not always suitable for the target compounds, while for single-drop microextraction (SDME), the stability of the drop in the sample may be a problem [3,4]. These limitations, as well as the need for even greater process control by a ffecting the retention time, and improving the extraction e fficiency and resolution of analytes, are responsible for the attempt to include new structures in the extraction process, which can help to achieve these goals [5]. Modifications, such as the introduction of additional processes in liquid-based sample preparation procedures or changes on the surface of sorbents in SPE-based extraction and microextraction procedures are a good direction in analytics, but often insu fficient to achieve the expected e ffects.

Equally as crucial as sample preparation is the process of the separation and detection of the compounds of interest. Among the many available techniques, chromatography or electrophoresis are most often used for the determination of pharmaceuticals in di fferent matrices. Chromatographic techniques exist in a variety of types: the oldest thin-layer chromatography (TLC), the commonly used high performance liquid chromatography (HPLC) and gas chromatography (GC) as well as the less popular supercritical fluid chromatography (SFC) techniques. These methods can be coupled to various types of detectors, including ultraviolet (UV), fluorescence (FL) or mass spectrometry (MS). There are many important parameters during the development and optimization of methods but the most important include the choice of the stationary phase (the place of separation of the analytes) and the mobile phase composition. If the analytes show excessive column adsorption, tailing of the chromatographic peaks occurs and their width is incorrect [6]. In turn, when choosing a mobile phase, problems can occur with obtaining separate peaks for specific compounds, a too long analysis time and low e fficiency [7]. However, other chromatographic conditions, such as the column temperature and the flow rate of the mobile phase as well as the parameters of detection should be carefully selected. This is a particular challenge for pharmaceutical determinations because their diverse structures and rich (despite extraction) matrices, and the necessity to detect many analytes at the same time, are just some of the reasons for di fficulties in their separation. In addition, it should be highlighted that the mobile phases in LC often contain large volumes of organic solvents which are highly toxic. An interesting alternative seems to be electromigration techniques such as capillary electrophoresis (CE), micellar electrokinetic chromatography (MEKC) or non-aqueous capillary electrophoresis (NACE). These analytical approaches have been considered to be powerful separation methods due to low sample and reagen<sup>t</sup> consumption, high e fficiency, and simplicity. On the other hand, CE-based methods have relatively low sensitivity which makes their application di fficult in real clinical and environmental studies. Thus, the above examples show that each stage in the development of an analytical method (both sample preparation and further analysis) can cause problems in performing experiments or in achieving reliable results.

Ionic liquids (ILs) are a relatively new class of compounds that became an object of special attention in the 21st century. Their simple cationic-anionic structure provides unusual and unparalleled properties. Therefore, it should not be surprising that their potential is exploited in many unrelated areas of science, for example, as a catalyst in chemical reactions [8], in drug delivery systems [9], in electroplating processes [10], in treating harmful compounds in wastewater [11], as matrices for analysis by matrix-assisted laser desorption/ionization mass spectrometry (MALDI-MS) [12] and many others. Scientists have also become interested in "designer solvents" in response to the constant demand for developing new and better methods, and improving the results obtained. The literature data show that their application is focused on sample preparation by extraction or microextraction as well as chromatography (adding ILs to the mobile phase or to prepare the stationary phase) and electrophoretic techniques (Figure 1).

**Figure 1.** Number of publications on the use of ILs in sample preparation (extraction and microextraction) and chromatographic and electrophoretic techniques in 2008–2019 (the authors own elaboration according to ScienceDirect data).

In pharmaceutical sciences ILs can be used for a variety of purposes: as active pharmaceutical substances (API-IL) [13], to determine the solvent residues and impurities in drug quality testing [14] or as a source of information about the presence of pharmaceuticals in biological and environmental samples [15,16]. An important argumen<sup>t</sup> supporting their use was also the introduction by Anastas in 1999 of the 12 principles of green chemistry [17]. Attention was drawn to the excessive use of organic solvents and the need to eliminate or reduce environmentally harmful factors. The search for alternatives resulted in the inclusion of ILs in experiments. Negligible vapor pressure, non-flammability, thermal stability, and the possibility of reuse are just some of the properties that have allowed ILs to be described as more environmentally-friendly [18]. It should be highlighted that as newer compounds their literature data are incomplete. However, this does not preclude their use at various stages of analytical testing, from sample preparation to detection and the improvement of results, even for difficult to determine analytes, including the quantification of pharmaceuticals in biological and environmental samples. These substances, with different pharmacokinetic activity, can be delivered directly and indirectly (animal-derived foods) to the human body in very low concentrations. Moreover, pharmaceutical concentrations in urine or bile are different from those in blood or saliva [19]. For this reason, it is necessary to develop a method that will be adequate for the specific biological sample. In the treatment of patients, combination therapy is often used, which results in the presence in the matrix sample of many drugs with different physical and chemical properties making it difficult to choose the best extraction and separation conditions. It should also be remembered that these are not always stable compounds, and to obtain information on their concentrations, it may also be necessary to determine the degradation products and/or metabolites in the presence of many endogenous matrix compounds [20]. Similar considerations can be made in the field of drug determination in environmental samples. According to the data reported in the literature, the sources of pharmaceuticals in wastewater, river waters, lake waters and others are improper drug disposal, hospital wastewater or animal feces. If they occur in an unchanged form, they may cause the risk of typical side effects after they enter the body. One group of drugs often identified in environmental samples are antibiotics, which may be responsible for the development of antibiotic-resistant bacteria [21]. As in biological samples, pharmaceuticals are present in the environment in very low concentrations. Sample purification, the isolation of analytes or the possibility of enriching the sample are crucial and influence the final efficiency of a method. As already mentioned, pharmaceuticals are compounds with high biological activity, so it is also important to develop simple, reproducible, quick methods, without the need to introduce additional steps to improve the safety of analysts [22]. The inclusion of ILs in their analyses not only improves safety due to the reduction of the use of organic solvent, but also, as confirmed by research, helps to overcome the mentioned di fficulties in the analysis of drugs and to improve the validation parameters and e fficiency. Therefore, the monitoring of these substances in both the environment and animal and human samples using IL-based environmentally-friendly analytical methods, which also o ffer reliability, and the qualitative and quantitative sensitivity and selectivity of the compounds of interest is one of the main tasks of modern analytics and chemistry.

The growing number of research papers on ILs has also increased interest in this topic in review articles. Their wide spectrum of possibilities is also clearly visible in the huge variety of subjects of such works. Some of them focused on IL in the context of "green chemistry", pointing to their grea<sup>t</sup> potential, but also disadvantages (the need to remove them from the environment, multi-stage synthesis) [23,24]. The reviews very often summarized their applications in sample preparation, especially solid phase microextraction. Most commonly, polymeric ionic liquids (PILs) were evaluated in such applications [25–28]. Some articles considered all the possibilities for using ILs, both at the extraction and detection stages [29–32]. However, the publication selection criteria in the review papers most often concerned analytical methods and techniques or the type of ILs and did not focus on the specific type of analytes or matrices. In addition, it should be noted that the dynamic development of analytical methods using IL requires continuous monitoring of current scientific reports and providing the latest information in current reviews papers. Thus, the purpose of this review was to summarize achievements in the use of ILs for the determination of drugs in biological and environmental samples. In order to properly understand the popularity of ILs in the modern laboratory, the section "Ionic Liquids" presents their history, with the inclusion of their most important features and properties. The basic criteria for choosing articles for the review was the use of ILs during the sample preparation procedure or in the chromatographic/electrophoretic separation of synthetic drugs quantified in biological and environmental samples. The review did not include endogenous compounds, substances responsible for addiction (e.g., nicotine and others) and herbal medicines, except for IL-applications in GC, TLC and SFC. This extension was made in order to fully present the capabilities of ILs and show current trends in the determination of di fferent active biological substances.
