/*********************** * 说明:化学元素转换 * 创建人:龚宇超 * 创建日期: * 修改人: * 修改日期: * 修改备注: * 版本:1.0.0.0 ***********************/ using System; using System.Collections.Generic; using System.Linq; using System.Text; using NPOI.SS.UserModel; namespace Lskj.Util { public sealed class ChemistryHelper { /// /// 说明:化学式上标 /// 创建人:龚宇超 /// 创建日期:2018-07-25 /// 修改人: /// 修改日期: /// 修改备注: /// 版本:1.0 /// /// The string. /// System.String. public static string GetSuperChar(string str) { switch (str) { case "0": return "\x2070"; case "1": return "\x00B9"; case "2": return "\x00B2"; case "3": return "\x00B3"; case "4": return "\x2074"; case "5": return "\x2075"; case "6": return "\x2076"; case "7": return "\x2077"; case "8": return "\x2078"; case "9": return "\x2079"; case "+": return "\x207A"; case "-": return "\x207B"; } return str; } /// /// 说明:化学式下标 /// 创建人:龚宇超 /// 创建日期:2018-07-25 /// 修改人: /// 修改日期: /// 修改备注: /// 版本:1.0 /// /// The string. /// System.String. public static string GetSubChar(string str) { switch (str) { case "0": return "\x2080"; case "1": return "\x2081"; case "2": return "\x2082"; case "3": return "\x2083"; case "4": return "\x2084"; case "5": return "\x2085"; case "6": return "\x2086"; case "7": return "\x2087"; case "8": return "\x2088"; case "9": return "\x2089"; case "+": return "\x208A"; case "-": return "\x208B"; } return str; } } }