# class DOMString

###

Module | khtml
Namespace | DOM
Class | DOMString
Inherits |

This class implements the basic string we use in the DOM. We do not use QString for 2 reasons: Memory overhead, and the missing explicit sharing of strings we need for the DOM.

All DOMStrings are explicitly shared (they behave like pointers), meaning that modifications to one instance will also modify all others. If you wish to get a DOMString that is independent, use copy().

### methods

- DOMString ( )

  returns ctor

  default constructor. Gives an empty DOMString

- DOMString (str, len)

  returns ctor

  Argument | Type | Default
  --- | --- | ---
  str | QChar |
  len | uint |

- DOMString (a0)

  returns ctor

  Argument | Type | Default
  --- | --- | ---
  a0 | QString |

- DOMString (str)

  returns ctor

  Argument | Type | Default
  --- | --- | ---
  str | char |

- DOMString (i)

  returns ctor
  Not implemented

  Argument | Type | Default
  --- | --- | ---
  i | DOMStringImpl |

- DOMString (str)

  returns ctor

  Argument | Type | Default
  --- | --- | ---
  str | DOM.DOMString |

- characters ( )

  returns QChar
  KDE 4.1.0 and later only

- copy ( )

  returns DOM.DOMString

- endsWith (str)

  returns bool
  KDE 4.1.0 and later only

  Argument | Type | Default
  --- | --- | ---
  str | DOM.DOMString |

- find (c, start)

  returns int

  Argument | Type | Default
  --- | --- | ---
  c | QChar |
  start | int | 0

- implementation ( )

  returns DOMStringImpl
  Not implemented

  Internal get a handle to the imlementation of the DOMString Use at own risk!!!

- insert (str, pos)

  returns Nothing

  Argument | Type | Default
  --- | --- | ---
  str | DOM.DOMString |
  pos | uint |

- isEmpty ( )

  returns bool

- isNull ( )

  returns bool

- length ( )

  returns uint

- lower ( )

  returns DOM.DOMString

  Returns a lowercase version of the string

- number (f)

  returns DOM.DOMString
  static
  KDE 4.1.0 and later only

  Argument | Type | Default
  --- | --- | ---
  f | float |

- operator + (str)

  returns DOM.DOMString

  Argument | Type | Default
  --- | --- | ---
  str | DOM.DOMString |

  add two DOMString's

- operator += (str)

  returns DOM.DOMString

  Argument | Type | Default
  --- | --- | ---
  str | DOM.DOMString |

  append str to this string

- operator [] (i)

  returns QChar

  Argument | Type | Default
  --- | --- | ---
  i | unsigned int |

  The character at position i of the DOMString. If i >= length(), the character returned will be 0.

- percentage ()

  returns bool, int (_percentage)

  Argument | Type | Default
  --- | --- | ---

- remove (pos, len)

  returns Nothing

  Argument | Type | Default
  --- | --- | ---
  pos | unsigned int |
  len | int | 1

- split (pos)

  returns DOM.DOMString

  Argument | Type | Default
  --- | --- | ---
  pos | unsigned int |

  Splits the string into two. The original string gets truncated to pos, and the rest is returned.

- string ( )

  returns QString

- toFloat (ok)

  returns float
  KDE 4.1.0 and later only

  Argument | Type | Default
  --- | --- | ---
  ok | bool | 0

- toInt ( )

  returns int

- toInt (ok)

  returns int
  KDE 4.1.0 and later only

  Argument | Type | Default
  --- | --- | ---
  ok | bool |

- truncate (len)

  returns Nothing

  Argument | Type | Default
  --- | --- | ---
  len | unsigned int |

- unicode ( )

  returns QChar

- upper ( )

  returns DOM.DOMString

  Returns an uppercase version of the string