Source code for pydiana.tools.string_manip
import numpy as np
import pandas as pd
import copy
import warnings
[docs]
def unitinstr(string):
"""
Function for finding the unit in a string by searching for '[....]'
Parameters
----------
string: string to be searched
Returns
-------
string with the unit or None if the string is None or unit is not found
"""
unit = None
if string is not None:
if "[" in string:
unit = string.split('[')[-1][:-1]
return unit
#def htmlsupscript(str)
#def htmlsubpscript(str)
#def htmlnewline(str)