ScriptSpot

Forum topic · General Scripting

string strip

By dussla · 2014-01-23

Description

example ) i have C:\Users\Public\Pictures\Sample Pictures\Desert.jpg

i want to extract Desert

is that possible ?

Comments (8)

barigazy · 2014-01-23

Still not understand.
Are you need to replace "Desert" to ffff-bbbb-cccc?
Show me the resulting string.

barigazy · 2014-01-23

Is this that you want

filename = @"C:\Users\Public\Pictures\Sample Pictures\Desert.jpg"
strarr = filterstring filename "\\."
--> result is
--> #("C:", "Users", "Public", "Pictures", "Sample Pictures", "Desert", "jpg")

perpect

dussla · 2014-01-23

are you god ?
you are my god ~~

.

Rodman · 2014-01-23

Search in the Maxscript documentation "String Values". You will find probably your happiness.

barigazy · 2014-01-23

getFilenameFile @"C:\Users\Public\Pictures\Sample Pictures\Desert.jpg"

wow

dussla · 2014-01-23

pls i have one question more .
sorry ~~

aaa*bbb*ccc

i would like to break them

aaa
bbb
ccc

pls how can i that ?

barigazy · 2014-01-23

what is aaa*bbb*ccc?

modify question

dussla · 2014-01-23

there is ffff-bbbb-cccc

i can't use * in file name

a=ffff
b=bbbb
c=cccc

a b c is variable

ffff-bbbb-cccc is name