การใส่ Single Quoted และ Double Quoted ใน Delphi

--

อย่างที่เรารู้กันครับ Delphi ใช้ Single Quoted ในการระบุว่า ตัวหนังสือที่อยู่ด้านใน เป็น ข้อความ เช่น

StrSQL := ‘select * from aa’

ดังนั้นเวลาด้านในข้อความเราต้องการให้มี Single Quoted ด้านในเราสามารถใช้

คำสั่งที่ว่า “QuotedStr”

https://docwiki.embarcadero.com/Libraries/Sydney/en/System.SysUtils.QuotedStr

ตัวอย่างเช่น QuotedStr(‘THB’) ก็จะได้เป็น ‘THB’

แต่ถ้าต้องการใส่ Double Quoted ลงไป ก็ต้องเปลี่ยนไปใช้

คำสั่งที่ชื่อว่า “AnsiQuotedStr”

https://docwiki.embarcadero.com/Libraries/Sydney/en/System.SysUtils.AnsiQuotedStr

ตัวอย่างเช่น AnsiQuotedStr(‘VAT’, ‘“‘) ก็จะได้เป็น “VAT”

แล้วครับ

Sign up to discover human stories that deepen your understanding of the world.

Free

Distraction-free reading. No ads.

Organize your knowledge with lists and highlights.

Tell your story. Find your audience.

Membership

Read member-only stories

Support writers you read most

Earn money for your writing

Listen to audio narrations

Read offline with the Medium app

--

--

No responses yet

Write a response