Welcome,
Guest
. Please
login
or
register
.
1 Hour
1 Day
1 Week
1 Month
Forever
Login with username, password and session length
News:
Home
Help
Login
Register
TheSwamp
»
Code Red
»
AutoLISP (Vanilla / Visual)
»
Topic:
Capital letter
« previous
next »
Print
Pages: [
1
] |
Go Down
Author
Topic: Capital letter (Read 1805 times)
0 Members and 1 Guest are viewing this topic.
MeasureUp
Bull Frog
Posts: 462
Capital letter
«
on:
September 15, 2014, 07:27:32 PM »
I know that "strcase" converts text to uppercase or lowercase.
Is there any function to convert the 1st letter of a text to uppercase and the rest to lowercase?
Thanks in advance.
Logged
Lee Mac
Seagull
Posts: 12914
London, England
WWW
Re: Capital letter
«
Reply #1 on:
September 15, 2014, 07:30:28 PM »
Text Case Functions
Logged
Lee Mac Programming
•
Twitter
•
Exchange App Store
MeasureUp
Bull Frog
Posts: 462
Re: Capital letter
«
Reply #2 on:
September 17, 2014, 08:39:25 PM »
Thanks Lee. Your tips are very helpful. Cheers!
Logged
Lee Mac
Seagull
Posts: 12914
London, England
WWW
Re: Capital letter
«
Reply #3 on:
September 18, 2014, 06:31:11 PM »
You're welcome!
Logged
Lee Mac Programming
•
Twitter
•
Exchange App Store
tedg
Swamp Rat
Posts: 811
Re: Capital letter
«
Reply #4 on:
September 19, 2014, 02:21:31 PM »
Quote from: MeasureUp on September 17, 2014, 08:39:25 PM
Thanks Lee. Your tips are very helpful. Cheers!
Tips?
More like well explained, downloadable working examples!!
Lee is a freakin' Genius, we're not worthy.
Don't forget to donate, and tip your bartenders and waitresses too.
Logged
Windows 10 Pro 64bit, AutoCAD 2023, REVIT 2023
JohnK
Administrator
Seagull
Posts: 10646
Re: Capital letter
«
Reply #5 on:
September 19, 2014, 02:36:47 PM »
Found this one and a ton more with a quick search of the forum (I'll post the one I supposedly done and let the other people post theirs).
Code - Auto/Visual Lisp:
[Select]
(
defun
J7:TitleCase
(
s
/
)
(
setq
s
(
strcase
s T
)
)
(
while
(
setq
sp
(
vl-string-position
32
s sp
)
)
(
setq
s
(
vl
-
string
-
subst
(
chr
(
boole
2
(
vl-string-elt
s
(
1+
sp
)
)
32
)
)
(
chr
(
vl-string-elt
s
(
1+
sp
)
)
)
s
(
1+
sp
)
)
sp
(
1+
sp
)
)
)
(
vl
-
string
-
subst
(
chr
(
boole
2
(
vl-string-elt
s
0
)
32
)
)
(
chr
(
vl-string-elt
s
0
)
)
s
)
)
Logged
TheSwamp.org
(serving the CAD community since 2003)
Member location map - Add yourself
Donate to TheSwamp.org
Print
Pages: [
1
] |
Go Up
« previous
next »
TheSwamp
»
Code Red
»
AutoLISP (Vanilla / Visual)
»
Topic:
Capital letter