918-git-images-111dconfigfileconfigure-oglivegit-imageslgromero-new-oglivemainmaint-cronmount-efivarfsmultivmmultivm-ogboot-installerogClonningEngineogboot-installer-jenkinsoglive-ipv6test-python-scriptsticket-301ticket-50ticket-50-oldticket-577ticket-585ticket-611ticket-612ticket-693ticket-700ubu24tplunification2use-local-agent-oglivevarios-instalacionwebconsole3
Rev | Line | |
---|
[b0dc2e4] | 1 | // ************************************************************************************************************************************************* |
---|
| 2 | // Libreria de scripts de Javascript |
---|
| 3 | // Autor: José Manuel Alonso (E.T.S.I.I.) Universidad de Sevilla |
---|
| 4 | // Fecha Creación:2003-2004 |
---|
| 5 | // Fecha Última modificación: Noviembre-2005 |
---|
| 6 | // Nombre del fichero: cadenas.js |
---|
| 7 | // Descripción : |
---|
| 8 | // Este fichero implementa funciones de uso común para cadenas |
---|
| 9 | // ************************************************************************************************************************************************* |
---|
| 10 | function TrimLeft( str ) { |
---|
| 11 | var resultStr = ""; |
---|
| 12 | var i = len = 0; |
---|
| 13 | if (str+"" == "undefined" || str == null) return null; |
---|
| 14 | str += ""; |
---|
| 15 | if (str.length == 0) |
---|
| 16 | resultStr = ""; |
---|
| 17 | else { |
---|
| 18 | len = str.length; |
---|
| 19 | while ((i <= len) && (str.charAt(i) == " ")) i++; |
---|
| 20 | resultStr = str.substring(i, len); |
---|
| 21 | } |
---|
| 22 | return resultStr; |
---|
| 23 | } |
---|
| 24 | //-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
---|
| 25 | function TrimRight( str ) { |
---|
| 26 | var resultStr = ""; |
---|
| 27 | var i = 0; |
---|
| 28 | if (str+"" == "undefined" || str == null) return null; |
---|
| 29 | str += ""; |
---|
| 30 | if (str.length == 0) |
---|
| 31 | resultStr = ""; |
---|
| 32 | else { |
---|
| 33 | i = str.length - 1; |
---|
| 34 | while ((i >= 0) && (str.charAt(i) == " ")) i--; |
---|
| 35 | resultStr = str.substring(0, i + 1); |
---|
| 36 | } |
---|
| 37 | return resultStr; |
---|
| 38 | } |
---|
| 39 | //-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
---|
| 40 | function Trim( str ) { |
---|
| 41 | var resultStr = ""; |
---|
| 42 | resultStr = TrimLeft(str); |
---|
| 43 | resultStr = TrimRight(resultStr); |
---|
| 44 | return resultStr; |
---|
| 45 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.