In the present work, we explored the diameter selectivity of dynamic self-assembly for the single-strand DNA (ssDNA) encapsulation in double-walled nanotubes (DWNTs) via molecular dynamics simulation method. Moreover, the pulling out process was carried out by steered molecular dynamics simulations. Considering pi-pi stacking and solvent accessibility together, base-CNT binding should be strongest on a graphene sheet and weakest on the inner CNT surface. When pulling the ssDNA out of the single-walled carbon nanotube (SWNT), the force exhibits characteristic fluctuations around a plateau about 300 pN. Each fluctuation force pulse to pull ssDNA corresponds to the exit of one base. In addition, the solvents used for the system are also of significant interest. Water does play an important role in encapsulation process but doesn't in the pulling out process.