Documentation / CalcMe

  • Demos
  • Visit our website
  • Contact us
  • MathType

    • Wiris Quizzes

      • Learning Lemur

        • CalcMe

          • MathPlayer

            • Store FAQ

              • VPAT for the electronic documentation

                • MathFlow

                  • BF FAQ

                    • Miscellaneous

                      • Wiris Integrations

                        • Home
                        • CalcMe
                        • Commands
                        • Programming Functions
                        • Programming Functions

                        Substring

                        Reading time: 1min

                        Finds a string in a larger string.

                        Syntax

                        substring(String, List, Integer)
                        
                        substring(String, List)
                        

                        Description

                        Given a string s, a list of strings {s1,...,sk}, and a positive integer n, searches si in s starting from the (n+1)-th char. If more than one sj appears in the original string, only the first appearance is returned. If the find ends with no matches, failed is returned. The output is a list with two elements: an integer with the position of the string and the string si.

                        Given a string s and a list of strings {s1,...,sk}, searches si in s. If more than one sj appears in the original string, only the first appearance is returned. If the find ends with no matches, failed is returned. The output is a list with two elements: an integer with the position of the string and the string si.

                        Nota

                        The math content is converted to MathML inside the corresponding string if there is a special character or any mathematical expression in the string. For instance, if the kernel receives s = "2 <math><mo>.</mo></math> 17", the substring function won't return the expected value. In this case, you need to include the string previously through the code editor.

                        Was this article helpful?

                        Yes
                        No
                        Give feedback about this article

                        Related Articles

                        • Programming Functions
                        • Append
                        • Belongs?
                        • Complement
                        • Constant list

                        Substring

                        Syntax Description Nota

                        Making people’s STEM work more meaningful

                        MathType

                        • MathType for Office Tools
                        • MathType for Mac
                        • MathType for Microsoft 365
                        • MathType for Google Workspace
                        • MathType for LMS
                        • MathType for XML Editors
                        • Arabic notation
                        • Our products accessibility
                        • MathType is online

                        WirisQuizzes

                        Learning Lemur

                        Solutions for Education

                        • Blackboard Learn
                        • Brightspace by D2L
                        • Canvas
                        • Google Classroom
                        • Moodle
                        • Schoology

                        Solutions for Publishing Houses

                        Solutions for Technical Writers

                        Solutions for Chemistry

                        Integrations

                        • HTML Editors
                        • MathType in WordPress

                        Pricing

                        Company

                        Careers

                        Blog

                        Contact Us

                        Buy Now

                        Plugin Downloads

                        © Wiris 2025

                        • Cookie Settings
                        • Cookie Policy
                        • Terms of Use
                        • Privacy Policy / GDPR
                        • Student Data Privacy
                        • Compliance
                        • Powered by Helpjuice
                        Expand