# Extending String Functions

**URL:** <https://forum.kirupa.com/t/extending-string-functions/107417>\
**Category:** Uncategorized\
**Created:** [April 15, 2004, 4:28am UTC](https://forum.kirupa.com/t/extending-string-functions/107417 "2004-04-15T04:28:20Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![simpleSoft](https://avatars.discourse-cdn.com/v4/letter/s/8baadc/32.png) [@simpleSoft](https://forum.kirupa.com/u/simpleSoft)\
**Post date:** [April 15, 2004, 4:28am UTC](https://forum.kirupa.com/t/extending-string-functions/107417/1 "2004-04-15T04:28:20Z")

</div>

More OOP woes…  
Here is what I want to do…extend the String class

```auto
 class example extends String {} 

```

and then I want to take things that are already strings and add a function to them which goes through and removes & and turns it back to & am things got some test code for that here

```auto

function htmlToString():Void {
  var args:Array = new Array();
  args = this.split("&amp;");
  this = args.join("&");
  args = this.split("&apos;");
  this = args.join("'");
  args = this.split("&quot;");
  this = args.join('"');
  args = this.split("&lt;");
  this = args.join('<');
  args = this.split("&gt;");
  this = args.join('>');
 }

```

But when I go and compile it I get error msg’s like this

> [@compiler](#):
>
> Line 13: Type mismatch in assignment statement: found String where htmlString is required.  
> this = args.join(‘\>’);
