[Wi...] Posted October 6, 2023 Share Posted October 6, 2023 I'm looking for a command to eliminate spaces in a name. For example: from "AA 12 B 6" converted into "AA12B6" by command. Is there a solution in PCM that I can't find? Link to comment Share on other sites More sharing options...
[Ma...] Posted October 6, 2023 Share Posted October 6, 2023 Hi I don't think there is an dedicated command for this. but I suggest to loop thru your string and then put it back together. >strElement< can cut out a part of your string and return it like: strElement(i, ";", string) or more characters strElement(i, ".pdf", string) sInput = " AA 12 B 6 - 0 8 1 5 " sOutput = "" sTemp = "" iTemp = 0 repeat iTemp = iTemp +1 sTemp = strElement(iTemp, " ",sInput) sOutput = text(sOutput, sTemp) until (sTemp == "") and (iTemp > 1) Link to comment Share on other sites More sharing options...
[Se...] Posted October 6, 2023 Share Posted October 6, 2023 Works great, thanks! and with this code you can replace any character with another (in this example spaces are replaced by underscores) sInput = " AA 12 B 6 - 0 8 1 5 " sOutput = "" iTemp = 0 repeat iTemp = iTemp +1 sChar = mid(sInput,iTemp,1) if sChar == " " sOutput = text(sOutput,"_" ) else sOutput = text(sOutput,sChar ) endif until (iTemp > len(sInput)) Link to comment Share on other sites More sharing options...
[Is...] Posted October 19, 2023 Share Posted October 19, 2023 little bit easier: textVal="AA 12 B 6" textTofind=" " replaceWith = "" textOutput=executeCode("'" + textVal + "' copyReplaceAll: '" + textTofind + "' with: '" + replaceWith + "'") Link to comment Share on other sites More sharing options...
[Fl...] Posted October 31, 2023 Share Posted October 31, 2023 Please sign in to view this quote. Hey there! "executeCode" dose execute the Code in which language? Link to comment Share on other sites More sharing options...
[Da...] Posted October 31, 2023 Share Posted October 31, 2023 Please sign in to view this quote. Squeak https://squeak.org/ Link to comment Share on other sites More sharing options...
[No...] Posted November 2, 2023 Share Posted November 2, 2023 More like Cincom Smalltalk 😉 https://www.youtube.com/watch?v=9e5UI_PMGEM Link to comment Share on other sites More sharing options...
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in