diff options
Diffstat (limited to 'OpenSim/Region/ScriptEngine/YEngine/XMRInstAbstract.cs')
-rw-r--r-- | OpenSim/Region/ScriptEngine/YEngine/XMRInstAbstract.cs | 70 |
1 files changed, 0 insertions, 70 deletions
diff --git a/OpenSim/Region/ScriptEngine/YEngine/XMRInstAbstract.cs b/OpenSim/Region/ScriptEngine/YEngine/XMRInstAbstract.cs index b3ff765..490de74 100644 --- a/OpenSim/Region/ScriptEngine/YEngine/XMRInstAbstract.cs +++ b/OpenSim/Region/ScriptEngine/YEngine/XMRInstAbstract.cs | |||
@@ -778,76 +778,6 @@ namespace OpenSim.Region.ScriptEngine.Yengine | |||
778 | } | 778 | } |
779 | 779 | ||
780 | /** | 780 | /** |
781 | * @brief Sane substring functions. | ||
782 | */ | ||
783 | public string xmrSubstring(string s, int offset) | ||
784 | { | ||
785 | if(offset >= s.Length) | ||
786 | return ""; | ||
787 | return s.Substring(offset); | ||
788 | } | ||
789 | |||
790 | // C# style | ||
791 | public string xmrSubstring(string s, int offset, int length) | ||
792 | { | ||
793 | if(length <= 0) | ||
794 | return ""; | ||
795 | if(offset >= s.Length) | ||
796 | return ""; | ||
797 | if(length > s.Length - offset) | ||
798 | length = s.Length - offset; | ||
799 | return s.Substring(offset, length); | ||
800 | } | ||
801 | |||
802 | // java style | ||
803 | public string xmrJSubstring(string s, int beg, int end) | ||
804 | { | ||
805 | if(end <= beg) | ||
806 | return ""; | ||
807 | if(beg >= s.Length) | ||
808 | return ""; | ||
809 | if(end > s.Length) | ||
810 | end = s.Length; | ||
811 | return s.Substring(beg, end - beg); | ||
812 | } | ||
813 | |||
814 | /** | ||
815 | * @brief String begins and ends with test. | ||
816 | */ | ||
817 | public bool xmrStringStartsWith(string s, string t) | ||
818 | { | ||
819 | return s.StartsWith(t); | ||
820 | } | ||
821 | |||
822 | public bool xmrStringEndsWith(string s, string t) | ||
823 | { | ||
824 | return s.EndsWith(t); | ||
825 | } | ||
826 | |||
827 | /** | ||
828 | * @brief [Last]IndexOf with starting position (just like C#) | ||
829 | */ | ||
830 | public int xmrStringIndexOf(string haystack, string needle) | ||
831 | { | ||
832 | return haystack.IndexOf(needle); | ||
833 | } | ||
834 | |||
835 | public int xmrStringIndexOf(string haystack, string needle, int startat) | ||
836 | { | ||
837 | return haystack.IndexOf(needle, startat); | ||
838 | } | ||
839 | |||
840 | public int xmrStringLastIndexOf(string haystack, string needle) | ||
841 | { | ||
842 | return haystack.LastIndexOf(needle); | ||
843 | } | ||
844 | |||
845 | public int xmrStringLastIndexOf(string haystack, string needle, int startat) | ||
846 | { | ||
847 | return haystack.LastIndexOf(needle, startat); | ||
848 | } | ||
849 | |||
850 | /** | ||
851 | * @brief These conversions throw exceptions if there is anything stinky... | 781 | * @brief These conversions throw exceptions if there is anything stinky... |
852 | */ | 782 | */ |
853 | public double xmrString2Float(string s) | 783 | public double xmrString2Float(string s) |