Problem while getting a string from excel

excel
activities
string
substring

#1

Hai Friends,
Encountered an issue while doing,
1- Read cell
2- Replacing all spaces in the string.
3- Getting first 8 character using sub string method.

While doing the 2 step all the white spaces are not going, after getting the sub-string the first 3 characters are not visible. It is only printing with 3rd position.
i’m attaching my workflow with an excel –2.zip (8.6 KB)
–please help me to find solution for this if possible.
Thanks and regards,
Akhil


#2

Hi Akhil,

Looks like there are about four spaces that come before DIRECTORS. That’s why you only get only part of the Substring that you want. This usually happens when the person who created the excel file just copies and pastes directly from a web page, especially with a different encoding. Unfortunately these aren’t just white spaces, so Trim will not work. You’ll either have to get rid of these trailing ASCII characters, or you’ll have to use something like Substring(0,12).


#3

@pathLessTaken Thanks for the reply.
I look forward with this :+1: