ScriptSpot home

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)
Branko Živković

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

Reply to Branko Živković
Branko Živković

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")

Reply to dussla
Rodman

.

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

Branko Živković

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

wow

pls i have one question more .
sorry ~~

aaa*bbb*ccc

i would like to break them

aaa
bbb
ccc

pls how can i that ?

modify question

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