I have a cell with multi lines, I use the oCell.getString() and there are '\n' in the result.when I try to replace '\n' to ' ', it failed with following code, it seems the tool did not found \n in the multi line cell. final_cell_str = Replace(oCell.getString(),"\n"," ")

As far as I know there never was a built-in function 'Replace' in OOo or AOO Basic. There are some additional Basic-functions coded themselves based on built-in functions and delivered with the software in the Basic container 'OpenOffice Macros'. The library 'Tools' there has a module 'Strings' providing a function 'ReplaceString' where the second and the third parameter are in reverse order as compared with the usage of 'Replace' in the above posted example.