The catenary is a curve that has played a significant role in the history of mathematics, finding applications in various disciplines such as mechanics, technology, architecture, the arts, and biology. In this paper, we introduce some generalizations by applying the variational method to deformable strings. We explore two specific cases: (i) in the first case, we investigate the nonlinear behavior of an elastic string with variable length, dependent on the applied boundary conditions; specifically, this analysis serves to introduce the variational method and demonstrate the process of finding analytical solutions; (ii) in the second case, we examine a deformable string with a constant length; however, we introduce mass redistribution within the string through nonlinear elastic interactions. In the first scenario, the deformation state of the string always describes elongation, as compression states prove to be unstable for fully flexible strings. In contrast, in the second scenario, the finite length constraint induces compressive states in specific configurations and regions of the string. However, it is worth noting that the solution to this problem exists only for values of the elastic constant that are not too low, a phenomenon that is studied in detail. We conduct here both analytical and graphical analyses of various geometries, comparing the elastic behavior of the two aforementioned types of strings. Understanding the elastic behavior of deformable strings, especially the second type involving mass redistribution, is crucial for enhancing comprehension in the study of biological filaments or fibers and soft matter. For instance, these investigations can contribute to understanding the mechanisms employed by cells to sense gravity or other mechanical conditions.