---
title: "Capitalize Mismatch..."
type: "forum-thread"
url: "https://www.webforum.nu/amne/asp/43835-capitalize-mismatch"
topic: "ASP"
topic_url: "https://www.webforum.nu/amne/asp"
author: "Jesper T"
published: "2002-05-15T17:30:09.000Z"
updated: "2002-05-15T17:34:05.000Z"
replies: 1
views: 173
page: 1
pages: 1
language: "sv-SE"
site: "webForum — webforum.nu"
rights: "Upphovsrätten till varje inlägg tillhör dess författare."
attribution: "Citera som: webForum, https://www.webforum.nu/amne/asp/43835-capitalize-mismatch"
---

# Capitalize Mismatch...

## #1 — Jesper T, 2002-05-15T17:30Z

```

Option Explicit

dim strText, textfield

'Gör små begynnelsebokstäver Stora
[b]Function Capitalize(strText)' Rad NIO[/b]
strText = UCase(Left(strText, 1)) & LCase(Mid(strText, 2))
For currChar = 1 To Len(strText)
If (Mid(strText, currChar, 1) = Chr(32)) OR (Mid(strText, currChar, 1) = "-") Then
newChar = UCase(Mid(strText, (currChar + 1), 1))
strText = Mid(strText, 1, currChar) & newChar & Mid(strText, currChar + 2)
End If
Next
Capitalize = strText

End Function

textfield = Capitalize(split(Request.Form("textfield"),","))

' Mera kod kommer här
```

 

> Microsoft VBScript runtime error '800a000d' 
> 
> Type mismatch: 'strText' 
> 
> /order/buffe_send.asp, line 9

 

MVH Jesper

Permalänk: https://www.webforum.nu/p/43835

## #2 — @nders, 2002-05-15T17:34Z

Du skickar in en array i funktionen, som förväntar sig en sträng.

Mvh,

Permalänk: https://www.webforum.nu/p/673808

---

Tråden på webben: https://www.webforum.nu/amne/asp/43835-capitalize-mismatch
