Set to contain the contents of a string.
496382
public void set(String string) {
        try {
            ByteBuffer bb = encode(string, true);
            bytes = bb.array();
            length = bb.limit();
        } catch (CharacterCodingException e) {
            throw new RuntimeException("Should not have happened " + e.toString());
        }
    }
461987
private function setStrings()
    {
        /*
         * Sift through the wreckage
         */
        foreach($this->parts as $part)
        {
            $this->checkPart($part);
        }

        /*
         *  if there's still nuthin', we must be on the feckin' home page
         */
        $this->strings[0] = ($this->strings[0] == '') ? '\/' : $this->strings[0];
        $this->strings[0] = '^' . $this->strings[0] . '$';
    }
825904
def content(self, value):
        
        value = self._prepend_seperator(value)
        self._content = value
862006
public boolean textContains(String value, String expectedSubstring) {
        boolean result = false;
        if (value != null) {
            result = value.contains(expectedSubstring);
        }
        return result;
    }
962872
function generateString(set, length) {
    var content = '';

    // Cannot generate a string from an empty set
    if (set.length <= 0) {
      return content;
    }

    for (var i = 0; i < length; i++) {
      content += String.fromCharCode(
        set[Math.floor(Math.random() * set.length)]
      );
    }

    return content;
  }
461601
public void setStringContent(String s) throws TLVParserException {
        if (s != null) {
            setContent(Util.toByteArray(s + '\0'));
        } else {
            setContent(new byte[]{'\0'});
        }
    }
790842
protected void setContentEnd(String contentEnd) {
        if (contentEnd == null) {
            contentEnd = StringUtils.EMPTY;
        }
        this.contentEnd = contentEnd;
    }
742911
public static void ensureNotEmptyContent( String name, boolean trim, String[] value )
    {
        ensureNotEmpty( name, value );
        for ( int i = 0; i < value.length; i++ ) {
            ensureNotEmpty( value[i] + "[" + i + "]", value[i] );
            if ( trim ) {
                ensureNotEmpty( value[i] + "[" + i + "]", value[i].trim() );
            }
        }
    }
1304341
public void text(String str)
    {
        if (fieldNames.isEmpty() || fieldValues.isEmpty())
            return;
        
        String val = (String)fieldValues.pop();
        val += str;
        fieldValues.push(val);
    }
806568
private final void setto(String s) {
        int l = s.length(); 
        int o = j+1;
        for (int i = 0; i < l; i++)
            sb.setCharAt(o+i, s.charAt(i));
        k = j+l;
    }
1362501
def set(self, value):
        

        if not isinstance(value, str_cls):
            raise TypeError(unwrap(
                '''
                %s value must be a unicode string, not %s
                ''',
                type_name(self),
                type_name(value)
            ))

        self._native = value

        if self._map is not None:
            if value in self._reverse_map:
                value = self._reverse_map[value]

        self.contents = b''
        first = None
        for index, part in enumerate(value.split('.')):
            part = int(part)

            # The first two parts are merged into a single byte
            if index == 0:
                first = part
                continue
            elif index == 1:
                part = (first * 40) + part

            encoded_part = chr_cls(0x7F & part)
            part = part >> 7
            while part > 0:
                encoded_part = chr_cls(0x80 | (0x7F & part)) + encoded_part
                part = part >> 7
            self.contents += encoded_part

        self._header = None
        if self._trailer != b'':
            self._trailer = b''
1262692
def make_str_content(content):
    
    if not isinstance(content, str):
        content = str(content.decode())
    return content
262498
def _add_info_from_string(self, text):
        """"""
        match = MemoryRegion.info_re.match(text)
        assert match is not None

        name = match.group(1)
        kb_count = int(match.group(2))
        self.info[name] = kb_count * 1024
1073933
def contains(self, value):
        
        str_value = StringConverter.to_nullable_string(value)

        for element in self:
            str_element = StringConverter.to_string(element)

            if str_value == None and str_element == None:
                return True
            if str_value == None or str_element == None:
                continue
            
            if str_value == str_element:
                return True

        return False
35862
def setcontents(source, identifier, pointer):
    """"""
    record = Record.get_record(identifier)
    Document(record, pointer).setcontents(source)
325028
def from_string(self, html_string):
        """"""
        self._html_parser._reset().feed(html_string)
        return self._html_parser.result
1087229
public void setContent(final String contentString, final String type) {
        final Content newContent = new Content();
        newContent.setType(type == null ? Content.HTML : type);
        newContent.setValue(contentString);
        final ArrayList<Content> contents = new ArrayList<Content>();
        contents.add(newContent);
        setContents(contents);
    }