Jump to content
amir0914

UpperCase Text

Recommended Posts

amir0914

Hi everyone,

I'm trying to find a function in Autolisp like "PROPER" function in excel. this function in excel sets the first character in a text string to uppercase, like :

test >> Test

t >> T

autolisp >> Autolisp

pc >> Pc

 

Is there the function in Autolisp?

Edited by amir0914

Share this post


Link to post
Share on other sites
ronjonp

I think you mean titlecase .

  • Like 1

Share this post


Link to post
Share on other sites
Tharwat
(strcat (strcase (substr "test" 1 1)) (substr "test" 2))

 

  • Like 1

Share this post


Link to post
Share on other sites
amir0914
26 minutes ago, Tharwat said:

(strcat (strcase (substr "test" 1 1)) (substr "test" 2))

 

This code worked great, thanks man.

Share this post


Link to post
Share on other sites
Tharwat
3 minutes ago, amir0914 said:

This code worked great, thanks man.

You're welcome anytime. :) 

  • Like 1

Share this post


Link to post
Share on other sites
ronjonp
12 minutes ago, amir0914 said:

This code worked great, thanks man.

FWIW, The proper function in excel will make a sentence title case. Tharwat's code will only change the first character.

image.png.e295a1af5809365c8d26d7c10f9bfe8c.png

Edited by ronjonp
  • Like 1

Share this post


Link to post
Share on other sites
amir0914
13 minutes ago, ronjonp said:

FWIW, The proper function in excel will make a sentence title case. Tharwat's code will only change the first character.

image.png.e295a1af5809365c8d26d7c10f9bfe8c.png

Yes, you are right, but my text strings isn't a sentence, if you look at my examples, they are only one word.

Edited by amir0914

Share this post


Link to post
Share on other sites
ronjonp
48 minutes ago, amir0914 said:

Yes, you are right, but my text strings isn't a sentence, if you look at my examples, they are only one word.

Sounds good .. just bringing it up because you referenced the 'PROPER' excel function. 😉

  • Like 1

Share this post


Link to post
Share on other sites
amir0914
1 hour ago, ronjonp said:

Sounds good .. just bringing it up because you referenced the 'PROPER' excel function. 😉

Thank you very much for following up, 

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...