string-tosubscript

Convert string to subscript characters (limited).


Keywords
string, to, subscript
License
MIT
Install
npm install string-tosubscript@0.1.4

Documentation

string-tosubscript

NPM

Convert string to subscript characters, limited support.

Only following characters can be superscripted:

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

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