How to Solve Spring Okta/Saml issue of SAML message intended destination endpoint did not match the recipient endpoint
Introduction I was trying to integrate Okta with Spring, and when I deploy the…
May 14, 2019
This post some useful tips of using strings, and some issues while dealing with strings
Hope, you have seen Python string format
to_search = 'my_name'
my_var = 'my_name_is_gorav'
if my_var.startswith(to_search):
print('Found')
Example, you have a string:
my_var = 'Name:GyanBlog'
You want to have anything after colon
name = my_var.split(':')[1]
Example: You have some long string like:
name = 'SERVICE_CLOUD_ACCOUNTS'
And, I want something like:
ServiceCloudAccounts
Then, use this code:
new_name = name.title().replace('_', '')
title() method will give you Service_Cloud_Accounts, then we have to remove any other characters we want
my_str.strip()
Your string has multiple spaces in between, and you want to convert them into one only.
import re
s = 'hey, i have multiple spaces'
re.sub("\s+", " ", s);
# Output
'hey, i have multiple spaces'
It works perfectly find with following cases
print('{hi}')
print('{hi} %s' %('hi'))
But, not with
website='GyanBlog.com'
print(f'hi { {website} .com}')
You have to use Double Curly-braces
website='GyanBlog.com'
{% raw %}
print(f'hi {{ {website} .com}}')
{% endraw %}
s = 'GyanBlog'
s[1:]
#Output: yanBlog
s = 'GyanBlog'
s[:-1]
Introduction I was trying to integrate Okta with Spring, and when I deploy the…
Introduction In our previous post How to configure Grafana on docker, we saw how…
Introduction In some of the cases, we need to specify namespace name along with…
Introduction Consider a scenario where you are building a docker image on your…
Code that I have is: It was: I changed it to: So, I needed to change button type…
This article shows some of common usages of JIRA rest apis. Note: This article…
Introduction This post has the complete code to send email through smtp server…
Introduction In a normal email sending code from python, I’m getting following…
Introduction In one of my app, I was using to talk to . I have used some event…
Introduction So you have a Django project, and want to run it using docker image…
Introduction It is very important to introduce few process so that your code and…
Introduction In this post, we will see a sample Jenkin Pipeline Groovy script…