// WriteStringf writes a formatted string to the ResponseWriter utilizing fmt.Fprintf. It also
// sets the Content-Type to "text/plain; charset=utf8".
194557
func WriteStringf(w http.ResponseWriter, format string, v ...interface{}) {
	w.Header().Set("Content-Type", "text/plain; charset=utf-8")
	fmt.Fprintf(w, format, v...)
}
1077002
func (f *Fpdf) Writef(h float64, fmtStr string, args ...interface{}) {
	f.write(h, sprintf(fmtStr, args...), 0, "")
}
596741
func WriteStringField(key string, val string) string {
	return strings.ToUpper(key) + ":" + quoteString(val) + CRLF
}
315347
func (f *MockFile) WriteString(s string) (ret int, err error) {
	f.Contents = s
	f.Seq = f.fs.next()
	return len(s), nil
}
578700
func (b *ByteBuffer) WriteString(s string) (int, error) {
	b.Lock()
	defer b.Unlock()
	return b.b.WriteString(s)
}
176586
func (r *Response) WriteString(s string) (n int, err error) {
	n, err = io.WriteString(r.ResponseWriter, s)
	r.size += int64(n)
	return
}
1108994
func (b *StringBuilder) WriteByte(c byte) error {
	b.copyCheck()
	b.buf = append(b.buf, c)
	return nil
}
893182
func (h OsHelperImpl) WriteStringToFile(filename string, contents string) error {
	err := ioutil.WriteFile(filename, []byte(contents), 0644)
	return err
}
181796
func WriteStringln(w io.Writer, s string) (int, error) {
	return Writeln(w, unsafe2.Bytes(s))
}
835367
func (s *Slice) WriteString(str string) (size int, err error) {
	*s = append(*s, str...)
	return len(str), nil
}
25455
func (enc *Encoder) writeString(s string) {
	enc.buf = append(enc.buf, s...)
}
464207
func (builder *MultipartBuilder) WriteFieldString(partName string, data string) error {
	return builder.Writer.WriteField(partName, data)
}
792919
func (z *Writer) writeString(s string) (err error) {
	// GZIP stores Latin-1 strings; error if non-Latin-1; convert if non-ASCII.
	needconv := false
	for _, v := range s {
		if v == 0 || v > 0xff {
			return errors.New("gzip.Write: non-Latin-1 header string")
		}
		if v > 0x7f {
			needconv = true
		}
	}
	if needconv {
		b := make([]byte, 0, len(s))
		for _, v := range s {
			b = append(b, byte(v))
		}
		_, err = z.w.Write(b)
	} else {
		_, err = io.WriteString(z.w, s)
	}
	if err != nil {
		return err
	}
	// GZIP strings are NUL-terminated.
	z.buf[0] = 0
	_, err = z.w.Write(z.buf[:1])
	return err
}
803144
func WriteStringToFile(filename string, value string) error {
	//	fmt.Printf("writing %s to file %s\n", value, filename)
	f, e := os.OpenFile(filename, os.O_WRONLY|os.O_TRUNC, 0666)
	if e != nil {
		return e
	}
	defer f.Close()

	_, e = f.WriteString(value)
	return e
}
916448
func (this *BytesBuffer) WriteByteString(byteStr string) error {
	var tmp []byte = make([]byte, 2)

	re := regexp.MustCompile("[^a-fA-F0-9]")
	clean_str := re.ReplaceAllString(byteStr, "")

	src := bytes.NewBufferString(clean_str)

	cnt := src.Len() / 2

	for i := 0; i < cnt; i++ {
		num := 0
		_, err := src.Read(tmp)
		if err != nil {
			return err
		}
		fmt.Sscanf(string(tmp), "%X", &num)
		this.Buffer.WriteByte(byte(num))
	}
	return nil
}
280965
func (f *File) SetString(in string, typ StringType) (err error) {
	s := C.CString(in)
	defer C.free(unsafe.Pointer(s))
	if C.sf_set_string(f.s, C.int(typ), s) != 0 {
		err = errors.New(C.GoString(C.sf_strerror(f.s)))
	}
	return
}
926253
func Fprintf(w io.Writer, format string, a ...interface{}) (n int, error error) {
	return fmt.Fprintf(w, format, wrap(a, false)...)
}