Skip to content

to subscript

Subhajit Sahu edited this page May 5, 2020 · 1 revision

Convert string to subscript characters, limited support.

Only following characters can be superscripted:

  • () + - 0123456789 =
  • a e hijklmnop rstuv x
const toSubscript = require('@extra-string/to-subscript');
// toSubscript(<string>)

toSubscript('hello world');
// 'ₕₑₗₗₒ wₒᵣₗd'
toSubscript('DECCAN PLATEAU');
// 'DECCAN PLATEAU'
'KNO'+toSubscript('3');
// 'KNO₃' (Potassium Nitrate)

extra-string

Clone this wiki locally