logo

Class string

logo

Introduction
Screenshots
License/Download
Installation
Userinterface
Function Index
Macro Programming
Links
Community

mouse left
no help

string Class Reference

string class more...

Public Member Functions

boolcontains(string str)
contain a string
intindexOf(string str, int index)
index of
intlastIndexOf(string str, int index)
index of
stringleft(int i)
left
intlength()
length
stringmid(int i, int k=-1)
mid of string
stringparameter(string str)
parameter
stringremove(string str)
remove
stringreplace(string macht,string with)
replace
stringsetDateTime(string format)
set date and time
stringsetDate(string format)
set date
stringsetNum(double d, int k)
set number
stringsetNum(int i)
set number
stringsetTime(string format)
set time
intsize()
size
voidtoDouble()
convert to double
voidtoInt()
convert to integer

Detailed Description

Conversion from/to int/double is done implicit.

Member Documentation

bool string::contains(string str)

    contain a string

    Returns:

    true if the string contains the string str. Otherwise false.

    string string::left(int i)

      left

      Returns:

      the left i char of the string

      int string::length()

        length

        Returns:

        length of the string (same as size)

        string string::mid(int i, int k=-1)

          mid of string

          Returns:

          length a path of the string starting at position i with the length k.
          The rest of the string starting at position i is returned if k is -1 or missing.

          string string::setNum(int i)

            set number

            Set the string to the number i

            string string::setNum(double d, int k)

              set number

              Set the string to the number d with precision of k

              void string::toInt()

                convert to integer

                The string is converted to a integer.

                void string::toDouble()

                  convert to double

                  The string is converted to a double.

                  int string::size()

                    size

                    Returns:

                    length of the string (same as length)

                    string string::setDateTime(string format)

                      set date and time

                      Set the string to the current date and time. With the string format the format can be set. Without the string the date is set to local setup.
                      The format string may contain:

                      Expression Output
                      dthe day as number without a leading zero (1 to 31)
                      ddthe day as number with a leading zero (01 to 31)
                      dddthe abbreviated localized day name (e.g. 'Mon' to 'Sun').
                      ddddthe long localized day name (e.g. 'Qt::Monday' to 'Qt::Sunday').
                      Mthe month as number without a leading zero (1-12)
                      MMthe month as number with a leading zero (01-12)
                      MMMthe abbreviated localized month name (e.g. 'Jan' to 'Dec').
                      MMMMthe long localized month name (e.g. 'January' to 'December').
                      yythe year as two digit number (00-99)
                      yyyythe year as four digit number (1752-8000)
                      hthe hour without a leading zero (0 to 23 or 1 to 12 if AM/PM display)
                      hhthe hour with a leading zero (00 to 23 or 01 to 12 if AM/PM display)
                      mthe minute without a leading zero (0 to 59)
                      mmthe minute with a leading zero (00 to 59)
                      sthe second without a leading zero (0 to 59)
                      ssthe second with a leading zero (00 to 59)
                      zthe milliseconds without leading zeroes (0 to 999)
                      zzzthe milliseconds with leading zeroes (000 to 999)
                      APuse AM/PM display. AP will be replaced by either "AM" or "PM".
                      apuse am/pm display. ap will be replaced by either "am" or "pm".

                      string string::setTime(string format)

                        set time

                        Set the string to the current time. With the string format the format can be set. Without the string the date is set to local setup. setDateTime for possible formats

                        string string::setDate(string format)

                          set date

                          Set the string to the current date. With the string format the format can be set. Without the string the date is set to local setup. setDateTime for possible formats

                          int string::indexOf(string str, int index)

                            index of

                            Returns the index position of the first occurrence of the string str in this string, searching forward from index position from. Returns -1 if str is not found.

                            int string::lastIndexOf(string str, int index)

                              index of

                              Returns the index position of the last occurrence of the string str in this string, searching backward from index position from. If from is -1, the search starts at the last character; if from is -2, at the next to last character and so on. Returns -1 if str is not found.

                              string string::remove(string str)

                                remove

                                Remove all str from the string. The removement is case sensitive.

                                string string::replace(string macht,string with)

                                  replace

                                  All existing strings match is replaced with with. The replacement is case sensitive.

                                  string string::parameter(string str)

                                    parameter

                                    Returns:

                                    the parameter str.

                                    Example:
                                    string s="type=2 width=4 length=6";
                                    s=s.parameter("width");
                                    // s="4";

                                    SourceForge.net LogoThis page may be outdated. Visit the new LayoutEditor homepage for the newest infomations!