string-substitution

TSQL varchar string manipulation problem

I have a variable which contains the following string: AL,CA,TN,VA,NY I have no control over what I get in that variable (comes from reporting services) I need to make it look like this: 'AL','CA','TN','VA','NY' How do I do this? ...

Unable to get results when passing a string via parameter substitution in gql query

Hi, I am able to properly pass a string variable to the gqlquery through parameter substitution, here's the code i've tried to use; user_name = self.request.get('username') #retrieved from UI p = models.UserDetails.all().filter('user_name = ', user_name).fetch(1) I don't get any results and the query fails silently. But when I hard c...

How do I write a method for multiple controllers that strips out an array of text?

I want to write a method that simplifies the names of corporations. I would like it to work as follows: @clear_company = clear_company(@company.name) What would happen is @company.name = "Company, Inc." @clear_company would be "Company" If @company.name = "Company Corporation" @clear_company would be "Company" There wouldn't be ex...

Why is the variable's value not substituted in the string ?

Hai, can anyone help me... When I write like: $file=file_get_contents('https://graph.facebook.com/me?access_token=1932993|twetrg|vsfgsewr'); the code gets response as well good. but when I write like: 1. $tk=''; 2. $tk='1932993|twetrg|vsfgsewr';//intialize the token value to variable 3. $file=file_get_contents('https://graph.faceb...